From 5b726ec7376373c00780cdd5108a6176104ffa91 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 29 Aug 2022 18:39:49 -0400 Subject: [PATCH 1/4] Added full Streams living standard --- .../webidls/enabled/ReadableStream.webidl | 47 ---- crates/web-sys/webidls/enabled/Streams.webidl | 227 ++++++++++++++++++ .../unstable/ReadableStreamBYOBReader.webidl | 22 -- .../ReadableStreamDefaultReader.webidl | 22 -- .../ReadableStreamGenericReader.webidl | 14 -- 5 files changed, 227 insertions(+), 105 deletions(-) delete mode 100644 crates/web-sys/webidls/enabled/ReadableStream.webidl create mode 100644 crates/web-sys/webidls/enabled/Streams.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl diff --git a/crates/web-sys/webidls/enabled/ReadableStream.webidl b/crates/web-sys/webidls/enabled/ReadableStream.webidl deleted file mode 100644 index 00c8bbc8a4a..00000000000 --- a/crates/web-sys/webidls/enabled/ReadableStream.webidl +++ /dev/null @@ -1,47 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#rs-class-definition - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface ReadableStream { - constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise cancel(optional any reason); - ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); - ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); - Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); - sequence tee(); - - async iterable(optional ReadableStreamIteratorOptions options = {}); -}; - -typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; - -enum ReadableStreamReaderMode { "byob" }; - -dictionary ReadableStreamGetReaderOptions { - ReadableStreamReaderMode mode; -}; - -dictionary ReadableStreamIteratorOptions { - boolean preventCancel = false; -}; - -dictionary ReadableWritablePair { - required ReadableStream readable; - required WritableStream writable; -}; - -dictionary StreamPipeOptions { - boolean preventClose = false; - boolean preventAbort = false; - boolean preventCancel = false; - AbortSignal signal; -}; diff --git a/crates/web-sys/webidls/enabled/Streams.webidl b/crates/web-sys/webidls/enabled/Streams.webidl new file mode 100644 index 00000000000..f5d853ff25d --- /dev/null +++ b/crates/web-sys/webidls/enabled/Streams.webidl @@ -0,0 +1,227 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* Copyright © WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative + * Commons Attribution 4.0 International License. To the extent portions of it are incorporated into + * source code, such portions in the source code are licensed under the BSD 3-Clause License + * instead. + * + * The origin of this IDL file is + * https://streams.spec.whatwg.org/#idl-index + */ + +[Exposed=*, Transferable] +interface ReadableStream { + constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise cancel(optional any reason); + ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); + ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); + Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); + sequence tee(); + + async iterable(optional ReadableStreamIteratorOptions options = {}); +}; + +typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; + +enum ReadableStreamReaderMode { "byob" }; + +dictionary ReadableStreamGetReaderOptions { + ReadableStreamReaderMode mode; +}; + +dictionary ReadableStreamIteratorOptions { + boolean preventCancel = false; +}; + +dictionary ReadableWritablePair { + required ReadableStream readable; + required WritableStream writable; +}; + +dictionary StreamPipeOptions { + boolean preventClose = false; + boolean preventAbort = false; + boolean preventCancel = false; + AbortSignal signal; +}; + +dictionary UnderlyingSource { + UnderlyingSourceStartCallback start; + UnderlyingSourcePullCallback pull; + UnderlyingSourceCancelCallback cancel; + ReadableStreamType type; + [EnforceRange] unsigned long long autoAllocateChunkSize; +}; + +typedef (ReadableStreamDefaultController or ReadableByteStreamController) ReadableStreamController; + +callback UnderlyingSourceStartCallback = any (ReadableStreamController controller); +callback UnderlyingSourcePullCallback = Promise (ReadableStreamController controller); +callback UnderlyingSourceCancelCallback = Promise (optional any reason); + +enum ReadableStreamType { "bytes" }; + +interface mixin ReadableStreamGenericReader { + readonly attribute Promise closed; + + Promise cancel(optional any reason); +}; + +[Exposed=*] +interface ReadableStreamDefaultReader { + constructor(ReadableStream stream); + + Promise read(); + undefined releaseLock(); +}; +ReadableStreamDefaultReader includes ReadableStreamGenericReader; + +dictionary ReadableStreamReadResult { + any value; + boolean done; +}; + +[Exposed=*] +interface ReadableStreamBYOBReader { + constructor(ReadableStream stream); + + Promise read(ArrayBufferView view); + undefined releaseLock(); +}; +ReadableStreamBYOBReader includes ReadableStreamGenericReader; + +[Exposed=*] +interface ReadableStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + + undefined close(); + undefined enqueue(optional any chunk); + undefined error(optional any e); +}; + +[Exposed=*] +interface ReadableByteStreamController { + readonly attribute ReadableStreamBYOBRequest? byobRequest; + readonly attribute unrestricted double? desiredSize; + + undefined close(); + undefined enqueue(ArrayBufferView chunk); + undefined error(optional any e); +}; + +[Exposed=*] +interface ReadableStreamBYOBRequest { + readonly attribute ArrayBufferView? view; + + undefined respond([EnforceRange] unsigned long long bytesWritten); + undefined respondWithNewView(ArrayBufferView view); +}; + +[Exposed=*, Transferable] +interface WritableStream { + constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise abort(optional any reason); + Promise close(); + WritableStreamDefaultWriter getWriter(); +}; + +dictionary UnderlyingSink { + UnderlyingSinkStartCallback start; + UnderlyingSinkWriteCallback write; + UnderlyingSinkCloseCallback close; + UnderlyingSinkAbortCallback abort; + any type; +}; + +callback UnderlyingSinkStartCallback = any (WritableStreamDefaultController controller); +callback UnderlyingSinkWriteCallback = Promise (any chunk, WritableStreamDefaultController controller); +callback UnderlyingSinkCloseCallback = Promise (); +callback UnderlyingSinkAbortCallback = Promise (optional any reason); + +[Exposed=*] +interface WritableStreamDefaultWriter { + constructor(WritableStream stream); + + readonly attribute Promise closed; + readonly attribute unrestricted double? desiredSize; + readonly attribute Promise ready; + + Promise abort(optional any reason); + Promise close(); + undefined releaseLock(); + Promise write(optional any chunk); +}; + +[Exposed=*] +interface WritableStreamDefaultController { + readonly attribute AbortSignal signal; + undefined error(optional any e); +}; + +[Exposed=*, Transferable] +interface TransformStream { + constructor(optional object transformer, + optional QueuingStrategy writableStrategy = {}, + optional QueuingStrategy readableStrategy = {}); + + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; + +dictionary Transformer { + TransformerStartCallback start; + TransformerTransformCallback transform; + TransformerFlushCallback flush; + any readableType; + any writableType; +}; + +callback TransformerStartCallback = any (TransformStreamDefaultController controller); +callback TransformerFlushCallback = Promise (TransformStreamDefaultController controller); +callback TransformerTransformCallback = Promise (any chunk, TransformStreamDefaultController controller); + +[Exposed=*] +interface TransformStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + + undefined enqueue(optional any chunk); + undefined error(optional any reason); + undefined terminate(); +}; + +dictionary QueuingStrategy { + unrestricted double highWaterMark; + QueuingStrategySize size; +}; + +callback QueuingStrategySize = unrestricted double (any chunk); + +dictionary QueuingStrategyInit { + required unrestricted double highWaterMark; +}; + +[Exposed=*] +interface ByteLengthQueuingStrategy { + constructor(QueuingStrategyInit init); + + readonly attribute unrestricted double highWaterMark; + readonly attribute Function size; +}; + +[Exposed=*] +interface CountQueuingStrategy { + constructor(QueuingStrategyInit init); + + readonly attribute unrestricted double highWaterMark; + readonly attribute Function size; +}; + +interface mixin GenericTransformStream { + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl deleted file mode 100644 index b8410e2e072..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader - */ - -[Exposed=(Window,Worker,Worklet)] -interface ReadableStreamBYOBReader { - constructor(ReadableStream stream); - - Promise read(ArrayBufferView view); - undefined releaseLock(); -}; -ReadableStreamBYOBReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamBYOBReadResult { - ArrayBufferView value; - boolean done; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl deleted file mode 100644 index 076da905c12..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader - */ - -[Exposed=(Window,Worker,Worklet)] -interface ReadableStreamDefaultReader { - constructor(ReadableStream stream); - - Promise read(); - undefined releaseLock(); -}; -ReadableStreamDefaultReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamDefaultReadResult { - any value; - boolean done; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl deleted file mode 100644 index a6c308dad41..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamgenericreader - */ - -interface mixin ReadableStreamGenericReader { - readonly attribute Promise closed; - - Promise cancel(optional any reason); -}; From 0cf5b7c8bbea5b8dcbe7c4b1d900538ea1e78424 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Wed, 31 Aug 2022 15:23:01 -0400 Subject: [PATCH 2/4] Regenerated web-sys files --- .../features/gen_ByteLengthQueuingStrategy.rs | 36 ++++++ .../src/features/gen_CountQueuingStrategy.rs | 36 ++++++ .../src/features/gen_QueuingStrategyInit.rs | 40 ++++++ .../gen_ReadableByteStreamController.rs | 67 ++++++++++ .../gen_ReadableStreamByobReadResult.rs | 70 ----------- .../features/gen_ReadableStreamByobReader.rs | 32 ----- .../features/gen_ReadableStreamByobRequest.rs | 52 ++++++++ .../gen_ReadableStreamDefaultController.rs | 59 +++++++++ .../gen_ReadableStreamDefaultReadResult.rs | 70 ----------- .../gen_ReadableStreamDefaultReader.rs | 28 ----- .../features/gen_ReadableStreamReadResult.rs | 53 ++++++++ .../src/features/gen_ReadableStreamType.rs | 10 ++ .../src/features/gen_TransformStream.rs | 78 ++++++++++++ .../gen_TransformStreamDefaultController.rs | 62 ++++++++++ .../web-sys/src/features/gen_Transformer.rs | 104 ++++++++++++++++ .../src/features/gen_UnderlyingSink.rs | 92 ++++++++++++++ .../src/features/gen_UnderlyingSource.rs | 98 +++++++++++++++ .../src/features/gen_WritableStream.rs | 98 +++++++++++++++ .../gen_WritableStreamDefaultController.rs | 36 ++++++ .../gen_WritableStreamDefaultWriter.rs | 117 ++++++++++++++++++ crates/web-sys/src/features/mod.rs | 86 +++++++++++-- 21 files changed, 1114 insertions(+), 210 deletions(-) create mode 100644 crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs create mode 100644 crates/web-sys/src/features/gen_CountQueuingStrategy.rs create mode 100644 crates/web-sys/src/features/gen_QueuingStrategyInit.rs create mode 100644 crates/web-sys/src/features/gen_ReadableByteStreamController.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamType.rs create mode 100644 crates/web-sys/src/features/gen_TransformStreamDefaultController.rs create mode 100644 crates/web-sys/src/features/gen_Transformer.rs create mode 100644 crates/web-sys/src/features/gen_UnderlyingSink.rs create mode 100644 crates/web-sys/src/features/gen_UnderlyingSource.rs create mode 100644 crates/web-sys/src/features/gen_WritableStreamDefaultController.rs diff --git a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs new file mode 100644 index 00000000000..c29737f5378 --- /dev/null +++ b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ByteLengthQueuingStrategy , typescript_type = "ByteLengthQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ByteLengthQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub type ByteLengthQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn high_water_mark(this: &ByteLengthQueuingStrategy) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn size(this: &ByteLengthQueuingStrategy) -> ::js_sys::Function; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "ByteLengthQueuingStrategy")] + #[doc = "The `new ByteLengthQueuingStrategy(..)` constructor, creating a new instance of `ByteLengthQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs new file mode 100644 index 00000000000..779ba5b5b5d --- /dev/null +++ b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CountQueuingStrategy , typescript_type = "CountQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CountQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub type CountQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn high_water_mark(this: &CountQueuingStrategy) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn size(this: &CountQueuingStrategy) -> ::js_sys::Function; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "CountQueuingStrategy")] + #[doc = "The `new CountQueuingStrategy(..)` constructor, creating a new instance of `CountQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs new file mode 100644 index 00000000000..89141292fbc --- /dev/null +++ b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs @@ -0,0 +1,40 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategyInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `QueuingStrategyInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub type QueuingStrategyInit; +} +impl QueuingStrategyInit { + #[doc = "Construct a new `QueuingStrategyInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn new(high_water_mark: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.high_water_mark(high_water_mark); + ret + } + #[doc = "Change the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn high_water_mark(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("highWaterMark"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs new file mode 100644 index 00000000000..6fed9016f1c --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs @@ -0,0 +1,67 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableByteStreamController , typescript_type = "ReadableByteStreamController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableByteStreamController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub type ReadableByteStreamController; + #[cfg(feature = "ReadableStreamByobRequest")] + # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = byobRequest)] + #[doc = "Getter for the `byobRequest` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/byobRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`, `ReadableStreamByobRequest`*"] + pub fn byob_request(this: &ReadableByteStreamController) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn desired_size(this: &ReadableByteStreamController) -> Option; + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn close(this: &ReadableByteStreamController); + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_array_buffer_view( + this: &ReadableByteStreamController, + chunk: &::js_sys::Object, + ); + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_u8_array(this: &ReadableByteStreamController, chunk: &mut [u8]); + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn error(this: &ReadableByteStreamController); + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn error_with_e(this: &ReadableByteStreamController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs deleted file mode 100644 index eb58aeca844..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamByobReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamByobReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamByobReadResult { - #[doc = "Construct a new `ReadableStreamByobReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -#[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamByobReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs index a630495bad7..1f051255192 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReader , typescript_type = "ReadableStreamBYOBReader")] @@ -11,22 +10,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamByobReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamBYOBReader")] #[doc = "The `new ReadableStreamByobReader(..)` constructor, creating a new instance of `ReadableStreamByobReader`."] @@ -34,70 +25,47 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_array_buffer_view( this: &ReadableStreamByobReader, view: &::js_sys::Object, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_u8_array( this: &ReadableStreamByobReader, view: &mut [u8], ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamByobReader); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamByobReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs new file mode 100644 index 00000000000..44eac4614ab --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs @@ -0,0 +1,52 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBRequest , typescript_type = "ReadableStreamBYOBRequest")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamByobRequest` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub type ReadableStreamByobRequest; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBRequest" , js_name = view)] + #[doc = "Getter for the `view` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/view)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn view(this: &ReadableStreamByobRequest) -> Option<::js_sys::Object>; + # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] + #[doc = "The `respond()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_u32(this: &ReadableStreamByobRequest, bytes_written: u32); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] + #[doc = "The `respond()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_f64(this: &ReadableStreamByobRequest, bytes_written: f64); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_array_buffer_view( + this: &ReadableStreamByobRequest, + view: &::js_sys::Object, + ); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_u8_array(this: &ReadableStreamByobRequest, view: &mut [u8]); +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs new file mode 100644 index 00000000000..d623f4b0ad0 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs @@ -0,0 +1,59 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultController , typescript_type = "ReadableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub type ReadableStreamDefaultController; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn desired_size(this: &ReadableStreamDefaultController) -> Option; + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn close(this: &ReadableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn enqueue(this: &ReadableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn enqueue_with_chunk( + this: &ReadableStreamDefaultController, + chunk: &::wasm_bindgen::JsValue, + ); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn error(this: &ReadableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn error_with_e(this: &ReadableStreamDefaultController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs deleted file mode 100644 index 82bbf8ca1e1..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamDefaultReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamDefaultReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamDefaultReadResult { - #[doc = "Construct a new `ReadableStreamDefaultReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -#[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamDefaultReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs index e47c2a3073f..6b12a74ca6b 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReader , typescript_type = "ReadableStreamDefaultReader")] @@ -11,22 +10,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamDefaultReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamDefaultReader")] #[doc = "The `new ReadableStreamDefaultReader(..)` constructor, creating a new instance of `ReadableStreamDefaultReader`."] @@ -34,53 +25,34 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamDefaultReader); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamDefaultReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs new file mode 100644 index 00000000000..794dc0e9b0a --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs @@ -0,0 +1,53 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamReadResult)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamReadResult` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub type ReadableStreamReadResult; +} +impl ReadableStreamReadResult { + #[doc = "Construct a new `ReadableStreamReadResult`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn done(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for ReadableStreamReadResult { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamType.rs b/crates/web-sys/src/features/gen_ReadableStreamType.rs new file mode 100644 index 00000000000..5bbe4467f36 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamType.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `ReadableStreamType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ReadableStreamType { + Bytes = "bytes", +} diff --git a/crates/web-sys/src/features/gen_TransformStream.rs b/crates/web-sys/src/features/gen_TransformStream.rs index d2a041a700c..b5cf766d4d6 100644 --- a/crates/web-sys/src/features/gen_TransformStream.rs +++ b/crates/web-sys/src/features/gen_TransformStream.rs @@ -40,6 +40,84 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(this: &TransformStream) -> WritableStream; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &TransformStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &TransformStream) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] + #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Result; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] + #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_transformer(transformer: &::js_sys::Object) + -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "QueuingStrategy")] + #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] + #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_transformer_and_writable_strategy( + transformer: &::js_sys::Object, + writable_strategy: &QueuingStrategy, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "QueuingStrategy")] + #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] + #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_transformer_and_writable_strategy_and_readable_strategy( + transformer: &::js_sys::Object, + writable_strategy: &QueuingStrategy, + readable_strategy: &QueuingStrategy, + ) -> Result; + #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs new file mode 100644 index 00000000000..4add045b0c0 --- /dev/null +++ b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs @@ -0,0 +1,62 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStreamDefaultController , typescript_type = "TransformStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TransformStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub type TransformStreamDefaultController; + # [wasm_bindgen (structural , method , getter , js_class = "TransformStreamDefaultController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn desired_size(this: &TransformStreamDefaultController) -> Option; + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn enqueue(this: &TransformStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn enqueue_with_chunk( + this: &TransformStreamDefaultController, + chunk: &::wasm_bindgen::JsValue, + ); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn error(this: &TransformStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn error_with_reason( + this: &TransformStreamDefaultController, + reason: &::wasm_bindgen::JsValue, + ); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] + #[doc = "The `terminate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/terminate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn terminate(this: &TransformStreamDefaultController); +} diff --git a/crates/web-sys/src/features/gen_Transformer.rs b/crates/web-sys/src/features/gen_Transformer.rs new file mode 100644 index 00000000000..c0dddae0727 --- /dev/null +++ b/crates/web-sys/src/features/gen_Transformer.rs @@ -0,0 +1,104 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Transformer)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Transformer` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub type Transformer; +} +impl Transformer { + #[doc = "Construct a new `Transformer`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn flush(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flush"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `readableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn readable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("readableType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `transform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn transform(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("transform"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `writableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn writable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("writableType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for Transformer { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSink.rs b/crates/web-sys/src/features/gen_UnderlyingSink.rs new file mode 100644 index 00000000000..dd69488671c --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSink.rs @@ -0,0 +1,92 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSink)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSink` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub type UnderlyingSink; +} +impl UnderlyingSink { + #[doc = "Construct a new `UnderlyingSink`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `abort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn abort(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("abort"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `close` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn close(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("close"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn type_(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn write(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("write"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for UnderlyingSink { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSource.rs b/crates/web-sys/src/features/gen_UnderlyingSource.rs new file mode 100644 index 00000000000..a6a90943179 --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSource.rs @@ -0,0 +1,98 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSource)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSource` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub type UnderlyingSource; +} +impl UnderlyingSource { + #[doc = "Construct a new `UnderlyingSource`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `autoAllocateChunkSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("autoAllocateChunkSize"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `cancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cancel"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `pull` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pull"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "ReadableStreamType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"] + pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for UnderlyingSource { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index 7f9ed141e58..da6e5956189 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -27,6 +27,56 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn locked(this: &WritableStream) -> bool; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] + #[doc = "Getter for the `locked` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn locked(this: &WritableStream) -> bool; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] + #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Result; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] + #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_underlying_sink( + underlying_sink: &::js_sys::Object, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "QueuingStrategy")] + #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] + #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_underlying_sink_and_strategy( + underlying_sink: &::js_sys::Object, + strategy: &QueuingStrategy, + ) -> Result; + #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] #[doc = ""] @@ -91,6 +141,42 @@ extern "C" { reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] + #[doc = "The `abort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn abort(this: &WritableStream) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] + #[doc = "The `abort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn abort_with_reason( + this: &WritableStream, + reason: &::wasm_bindgen::JsValue, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn close(this: &WritableStream) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] @@ -113,4 +199,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStreamDefaultWriter")] + # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = getWriter)] + #[doc = "The `getWriter()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; } diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs new file mode 100644 index 00000000000..424a635c96a --- /dev/null +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultController , typescript_type = "WritableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WritableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub type WritableStreamDefaultController; + #[cfg(feature = "AbortSignal")] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultController" , js_name = signal)] + #[doc = "Getter for the `signal` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/signal)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WritableStreamDefaultController`*"] + pub fn signal(this: &WritableStreamDefaultController) -> AbortSignal; + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error(this: &WritableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error_with_e(this: &WritableStreamDefaultController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index 1ba5bd8b6ce..bcbe1210875 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -49,6 +49,51 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] + #[doc = "Getter for the `closed` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn desired_size(this: &WritableStreamDefaultWriter) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = ready)] + #[doc = "Getter for the `ready` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/ready)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] + #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(stream: &WritableStream) -> Result; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] @@ -86,6 +131,31 @@ extern "C" { reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] + #[doc = "The `abort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] + #[doc = "The `abort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn abort_with_reason( + this: &WritableStreamDefaultWriter, + reason: &::wasm_bindgen::JsValue, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] @@ -97,6 +167,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] + #[doc = "The `releaseLock()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn release_lock(this: &WritableStreamDefaultWriter); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] @@ -132,4 +224,29 @@ extern "C" { this: &WritableStreamDefaultWriter, chunk: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_with_chunk( + this: &WritableStreamDefaultWriter, + chunk: &::wasm_bindgen::JsValue, + ) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 59d6818792d..dfb2a94cac1 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -718,6 +718,12 @@ mod gen_BrowserFindDirection; #[cfg(feature = "BrowserFindDirection")] pub use gen_BrowserFindDirection::*; +#[cfg(feature = "ByteLengthQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_ByteLengthQueuingStrategy; +#[cfg(feature = "ByteLengthQueuingStrategy")] +pub use gen_ByteLengthQueuingStrategy::*; + #[cfg(feature = "Cache")] #[allow(non_snake_case)] mod gen_Cache; @@ -1156,6 +1162,12 @@ mod gen_Coordinates; #[cfg(feature = "Coordinates")] pub use gen_Coordinates::*; +#[cfg(feature = "CountQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_CountQueuingStrategy; +#[cfg(feature = "CountQueuingStrategy")] +pub use gen_CountQueuingStrategy::*; + #[cfg(feature = "Credential")] #[allow(non_snake_case)] mod gen_Credential; @@ -5656,6 +5668,12 @@ mod gen_QueuingStrategy; #[cfg(feature = "QueuingStrategy")] pub use gen_QueuingStrategy::*; +#[cfg(feature = "QueuingStrategyInit")] +#[allow(non_snake_case)] +mod gen_QueuingStrategyInit; +#[cfg(feature = "QueuingStrategyInit")] +pub use gen_QueuingStrategyInit::*; + #[cfg(feature = "RadioNodeList")] #[allow(non_snake_case)] mod gen_RadioNodeList; @@ -5680,29 +5698,35 @@ mod gen_RcwnStatus; #[cfg(feature = "RcwnStatus")] pub use gen_RcwnStatus::*; +#[cfg(feature = "ReadableByteStreamController")] +#[allow(non_snake_case)] +mod gen_ReadableByteStreamController; +#[cfg(feature = "ReadableByteStreamController")] +pub use gen_ReadableByteStreamController::*; + #[cfg(feature = "ReadableStream")] #[allow(non_snake_case)] mod gen_ReadableStream; #[cfg(feature = "ReadableStream")] pub use gen_ReadableStream::*; -#[cfg(feature = "ReadableStreamByobReadResult")] -#[allow(non_snake_case)] -mod gen_ReadableStreamByobReadResult; -#[cfg(feature = "ReadableStreamByobReadResult")] -pub use gen_ReadableStreamByobReadResult::*; - #[cfg(feature = "ReadableStreamByobReader")] #[allow(non_snake_case)] mod gen_ReadableStreamByobReader; #[cfg(feature = "ReadableStreamByobReader")] pub use gen_ReadableStreamByobReader::*; -#[cfg(feature = "ReadableStreamDefaultReadResult")] +#[cfg(feature = "ReadableStreamByobRequest")] #[allow(non_snake_case)] -mod gen_ReadableStreamDefaultReadResult; -#[cfg(feature = "ReadableStreamDefaultReadResult")] -pub use gen_ReadableStreamDefaultReadResult::*; +mod gen_ReadableStreamByobRequest; +#[cfg(feature = "ReadableStreamByobRequest")] +pub use gen_ReadableStreamByobRequest::*; + +#[cfg(feature = "ReadableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_ReadableStreamDefaultController; +#[cfg(feature = "ReadableStreamDefaultController")] +pub use gen_ReadableStreamDefaultController::*; #[cfg(feature = "ReadableStreamDefaultReader")] #[allow(non_snake_case)] @@ -5722,12 +5746,24 @@ mod gen_ReadableStreamIteratorOptions; #[cfg(feature = "ReadableStreamIteratorOptions")] pub use gen_ReadableStreamIteratorOptions::*; +#[cfg(feature = "ReadableStreamReadResult")] +#[allow(non_snake_case)] +mod gen_ReadableStreamReadResult; +#[cfg(feature = "ReadableStreamReadResult")] +pub use gen_ReadableStreamReadResult::*; + #[cfg(feature = "ReadableStreamReaderMode")] #[allow(non_snake_case)] mod gen_ReadableStreamReaderMode; #[cfg(feature = "ReadableStreamReaderMode")] pub use gen_ReadableStreamReaderMode::*; +#[cfg(feature = "ReadableStreamType")] +#[allow(non_snake_case)] +mod gen_ReadableStreamType; +#[cfg(feature = "ReadableStreamType")] +pub use gen_ReadableStreamType::*; + #[cfg(feature = "ReadableWritablePair")] #[allow(non_snake_case)] mod gen_ReadableWritablePair; @@ -7732,6 +7768,18 @@ mod gen_TransformStream; #[cfg(feature = "TransformStream")] pub use gen_TransformStream::*; +#[cfg(feature = "TransformStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_TransformStreamDefaultController; +#[cfg(feature = "TransformStreamDefaultController")] +pub use gen_TransformStreamDefaultController::*; + +#[cfg(feature = "Transformer")] +#[allow(non_snake_case)] +mod gen_Transformer; +#[cfg(feature = "Transformer")] +pub use gen_Transformer::*; + #[cfg(feature = "TransitionEvent")] #[allow(non_snake_case)] mod gen_TransitionEvent; @@ -7810,6 +7858,18 @@ mod gen_UiEventInit; #[cfg(feature = "UiEventInit")] pub use gen_UiEventInit::*; +#[cfg(feature = "UnderlyingSink")] +#[allow(non_snake_case)] +mod gen_UnderlyingSink; +#[cfg(feature = "UnderlyingSink")] +pub use gen_UnderlyingSink::*; + +#[cfg(feature = "UnderlyingSource")] +#[allow(non_snake_case)] +mod gen_UnderlyingSource; +#[cfg(feature = "UnderlyingSource")] +pub use gen_UnderlyingSource::*; + #[cfg(feature = "Url")] #[allow(non_snake_case)] mod gen_Url; @@ -8626,6 +8686,12 @@ mod gen_WritableStream; #[cfg(feature = "WritableStream")] pub use gen_WritableStream::*; +#[cfg(feature = "WritableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_WritableStreamDefaultController; +#[cfg(feature = "WritableStreamDefaultController")] +pub use gen_WritableStreamDefaultController::*; + #[cfg(feature = "WritableStreamDefaultWriter")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultWriter; From 6cf73b4a07f7a7e4a7981100d3d64597e4bc85e4 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Wed, 31 Aug 2022 16:08:05 -0400 Subject: [PATCH 3/4] Removed duplicate Stream API IDLs --- .../webidls/unstable/TransformStream.webidl | 16 -------------- .../webidls/unstable/WritableStream.webidl | 19 ---------------- .../WritableStreamDefaultWriter.webidl | 22 ------------------- 3 files changed, 57 deletions(-) delete mode 100644 crates/web-sys/webidls/unstable/TransformStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/WritableStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl diff --git a/crates/web-sys/webidls/unstable/TransformStream.webidl b/crates/web-sys/webidls/unstable/TransformStream.webidl deleted file mode 100644 index 61275a85237..00000000000 --- a/crates/web-sys/webidls/unstable/TransformStream.webidl +++ /dev/null @@ -1,16 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#transformstream - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface TransformStream { - constructor(optional object transformer, optional QueuingStrategy writableStrategy = {}, optional QueuingStrategy readableStrategy = {}); - - readonly attribute ReadableStream readable; - readonly attribute WritableStream writable; -}; diff --git a/crates/web-sys/webidls/unstable/WritableStream.webidl b/crates/web-sys/webidls/unstable/WritableStream.webidl deleted file mode 100644 index 0eb709ed3c8..00000000000 --- a/crates/web-sys/webidls/unstable/WritableStream.webidl +++ /dev/null @@ -1,19 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#ws-class-definition - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface WritableStream { - constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise abort(optional any reason); - Promise close(); - WritableStreamDefaultWriter getWriter(); -}; diff --git a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl b/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl deleted file mode 100644 index 9daa09a3d35..00000000000 --- a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#writablestreamdefaultwriter - */ - -[Exposed=(Window,Worker,Worklet)] -interface WritableStreamDefaultWriter { - constructor(WritableStream stream); - - readonly attribute Promise closed; - readonly attribute unrestricted double? desiredSize; - readonly attribute Promise ready; - - Promise abort(optional any reason); - Promise close(); - undefined releaseLock(); - Promise write(optional any chunk); -}; From 1b654882555e15c1098c2a73a5cc1b80a0200861 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Wed, 31 Aug 2022 16:11:08 -0400 Subject: [PATCH 4/4] Regenerated web-sys files --- .../src/features/gen_ReadableStream.rs | 8 - .../src/features/gen_ReadableWritablePair.rs | 8 - .../src/features/gen_TransformStream.rs | 90 ---------- .../src/features/gen_WritableStream.rs | 122 ------------- .../gen_WritableStreamDefaultWriter.rs | 161 ------------------ 5 files changed, 389 deletions(-) diff --git a/crates/web-sys/src/features/gen_ReadableStream.rs b/crates/web-sys/src/features/gen_ReadableStream.rs index a68f982b964..c66b913be9e 100644 --- a/crates/web-sys/src/features/gen_ReadableStream.rs +++ b/crates/web-sys/src/features/gen_ReadableStream.rs @@ -112,7 +112,6 @@ extern "C" { transform: &ReadableWritablePair, options: &StreamPipeOptions, ) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -120,11 +119,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -132,9 +127,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to_with_options( this: &ReadableStream, destination: &WritableStream, diff --git a/crates/web-sys/src/features/gen_ReadableWritablePair.rs b/crates/web-sys/src/features/gen_ReadableWritablePair.rs index 0ce861e74ab..8a34d98aca5 100644 --- a/crates/web-sys/src/features/gen_ReadableWritablePair.rs +++ b/crates/web-sys/src/features/gen_ReadableWritablePair.rs @@ -11,14 +11,10 @@ extern "C" { pub type ReadableWritablePair; } impl ReadableWritablePair { - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "ReadableStream", feature = "WritableStream",))] #[doc = "Construct a new `ReadableWritablePair`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(readable: &ReadableStream, writable: &WritableStream) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); @@ -44,14 +40,10 @@ impl ReadableWritablePair { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[doc = "Change the `writable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(&mut self, val: &WritableStream) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( diff --git a/crates/web-sys/src/features/gen_TransformStream.rs b/crates/web-sys/src/features/gen_TransformStream.rs index b5cf766d4d6..9dd64d45d33 100644 --- a/crates/web-sys/src/features/gen_TransformStream.rs +++ b/crates/web-sys/src/features/gen_TransformStream.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStream , typescript_type = "TransformStream")] @@ -11,11 +10,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type TransformStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] #[doc = "Getter for the `readable` field of this object."] @@ -23,11 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn readable(this: &TransformStream) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] #[doc = "Getter for the `writable` field of this object."] @@ -35,89 +26,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(this: &TransformStream) -> WritableStream; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "ReadableStream")] - # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] - #[doc = "Getter for the `readable` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn readable(this: &TransformStream) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "WritableStream")] - # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] - #[doc = "Getter for the `writable` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn writable(this: &TransformStream) -> WritableStream; - #[cfg(web_sys_unstable_apis)] - #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] - #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] - #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] - #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new_with_transformer(transformer: &::js_sys::Object) - -> Result; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "QueuingStrategy")] - #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] - #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new_with_transformer_and_writable_strategy( - transformer: &::js_sys::Object, - writable_strategy: &QueuingStrategy, - ) -> Result; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "QueuingStrategy")] - #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] - #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new_with_transformer_and_writable_strategy_and_readable_strategy( - transformer: &::js_sys::Object, - writable_strategy: &QueuingStrategy, - readable_strategy: &QueuingStrategy, - ) -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index da6e5956189..d4123011279 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStream , typescript_type = "WritableStream")] @@ -11,31 +10,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStream; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] #[doc = "Getter for the `locked` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn locked(this: &WritableStream) -> bool; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] - #[doc = "Getter for the `locked` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn locked(this: &WritableStream) -> bool; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] @@ -76,118 +57,30 @@ extern "C" { underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, ) -> Result; - #[cfg(web_sys_unstable_apis)] - #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] - #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] - #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] - #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new_with_underlying_sink( - underlying_sink: &::js_sys::Object, - ) -> Result; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "QueuingStrategy")] - #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] - #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new_with_underlying_sink_and_strategy( - underlying_sink: &::js_sys::Object, - strategy: &QueuingStrategy, - ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] - #[doc = "The `abort()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn abort_with_reason( - this: &WritableStream, - reason: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn abort(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] - #[doc = "The `abort()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStream, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] - #[doc = "The `close()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn close(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStreamDefaultWriter")] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = getWriter)] #[doc = "The `getWriter()` method."] @@ -195,20 +88,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "WritableStreamDefaultWriter")] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = getWriter)] - #[doc = "The `getWriter()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; } diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index bcbe1210875..b52551db43d 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultWriter , typescript_type = "WritableStreamDefaultWriter")] @@ -11,89 +10,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStreamDefaultWriter; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] #[doc = "Getter for the `desiredSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/desiredSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn desired_size(this: &WritableStreamDefaultWriter) -> Option; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = ready)] #[doc = "Getter for the `ready` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/ready)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] - #[doc = "Getter for the `closed` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] - #[doc = "Getter for the `desiredSize` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/desiredSize)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn desired_size(this: &WritableStreamDefaultWriter) -> Option; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = ready)] - #[doc = "Getter for the `ready` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/ready)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "WritableStream")] - #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] - #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(stream: &WritableStream) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] @@ -101,150 +39,51 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &WritableStream) -> Result; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] - #[doc = "The `abort()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] - #[doc = "The `abort()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn abort_with_reason( - this: &WritableStreamDefaultWriter, - reason: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStreamDefaultWriter, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] - #[doc = "The `close()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &WritableStreamDefaultWriter); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] - #[doc = "The `releaseLock()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn release_lock(this: &WritableStreamDefaultWriter); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] - #[doc = "The `write()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] - #[doc = "The `write()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_with_chunk( - this: &WritableStreamDefaultWriter, - chunk: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_chunk( this: &WritableStreamDefaultWriter, chunk: &::wasm_bindgen::JsValue,