Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web-sys: Added full Streams WebIDL (#3046)
* Added full Streams living standard * Regenerated web-sys files * Removed duplicate Stream API IDLs * Regenerated web-sys files
- Loading branch information
Showing
31 changed files
with
1,048 additions
and
468 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ByteLengthQueuingStrategy, JsValue>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<CountQueuingStrategy, JsValue>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
crates/web-sys/src/features/gen_ReadableByteStreamController.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ReadableStreamByobRequest>; | ||
# [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<f64>; | ||
# [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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.