diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ee10794ff..158141f7a83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ * Implement `From>` for `JsValue`. [#3877](https://github.com/rustwasm/wasm-bindgen/pull/3877) +### Changed + +* Generate JS bindings for WebIDL dictionary setters instead of using `Reflect`. This increases the size of the Web API bindings but should be more performant. Also, importing getters/setters from JS now supports specifying the JS attribute name as a string, e.g. `#[wasm_bindgen(method, setter = "x-cdm-codecs")]`. + [#3898](https://github.com/rustwasm/wasm-bindgen/pull/3898) + +### Fixed + +* Fix `catch` not being thread-safe. + [#3879](https://github.com/rustwasm/wasm-bindgen/pull/3879) + -------------------------------------------------------------------------------- ## [0.2.92](https://github.com/rustwasm/wasm-bindgen/compare/0.2.91...0.2.92) diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index 9cd8ebec140..95c62d63bd8 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -242,10 +242,10 @@ pub struct Operation { pub enum OperationKind { /// A standard method, nothing special Regular, - /// A method for getting the value of the provided Ident - Getter(Option), - /// A method for setting the value of the provided Ident - Setter(Option), + /// A method for getting the value of the provided Ident or String + Getter(Option), + /// A method for setting the value of the provided Ident or String + Setter(Option), /// A dynamically intercepted getter IndexingGetter, /// A dynamically intercepted setter diff --git a/crates/backend/src/encode.rs b/crates/backend/src/encode.rs index e7c7624e0ea..9341ac170dd 100644 --- a/crates/backend/src/encode.rs +++ b/crates/backend/src/encode.rs @@ -531,12 +531,12 @@ fn from_ast_method_kind<'a>( let is_static = *is_static; let kind = match kind { ast::OperationKind::Getter(g) => { - let g = g.as_ref().map(|g| intern.intern(g)); + let g = g.as_ref().map(|g| intern.intern_str(g)); OperationKind::Getter(g.unwrap_or_else(|| function.infer_getter_property())) } ast::OperationKind::Regular => OperationKind::Regular, ast::OperationKind::Setter(s) => { - let s = s.as_ref().map(|s| intern.intern(s)); + let s = s.as_ref().map(|s| intern.intern_str(s)); OperationKind::Setter(match s { Some(s) => s, None => intern.intern_str(&function.infer_setter_property()?), diff --git a/crates/macro-support/src/parser.rs b/crates/macro-support/src/parser.rs index eee4f66e95d..2b161c04c3b 100644 --- a/crates/macro-support/src/parser.rs +++ b/crates/macro-support/src/parser.rs @@ -65,8 +65,8 @@ macro_rules! attrgen { (module, Module(Span, String, Span)), (raw_module, RawModule(Span, String, Span)), (inline_js, InlineJs(Span, String, Span)), - (getter, Getter(Span, Option)), - (setter, Setter(Span, Option)), + (getter, Getter(Span, Option)), + (setter, Setter(Span, Option)), (indexing_getter, IndexingGetter(Span)), (indexing_setter, IndexingSetter(Span)), (indexing_deleter, IndexingDeleter(Span)), @@ -299,10 +299,15 @@ impl Parse for BindgenAttr { return Ok(BindgenAttr::$variant(attr_span, ident)) }); - (@parser $variant:ident(Span, Option)) => ({ + (@parser $variant:ident(Span, Option)) => ({ if input.parse::().is_ok() { + if input.peek(syn::LitStr) { + let litstr = input.parse::()?; + return Ok(BindgenAttr::$variant(attr_span, Some(litstr.value()))) + } + let ident = input.parse::()?.0; - return Ok(BindgenAttr::$variant(attr_span, Some(ident))) + return Ok(BindgenAttr::$variant(attr_span, Some(ident.to_string()))) } else { return Ok(BindgenAttr::$variant(attr_span, None)); } diff --git a/crates/web-sys/src/features/gen_AddEventListenerOptions.rs b/crates/web-sys/src/features/gen_AddEventListenerOptions.rs index 11041cbb87f..b453ed0641c 100644 --- a/crates/web-sys/src/features/gen_AddEventListenerOptions.rs +++ b/crates/web-sys/src/features/gen_AddEventListenerOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] pub type AddEventListenerOptions; + #[wasm_bindgen(method, setter = "capture")] + fn capture_shim(this: &AddEventListenerOptions, val: bool); + #[wasm_bindgen(method, setter = "once")] + fn once_shim(this: &AddEventListenerOptions, val: bool); + #[wasm_bindgen(method, setter = "passive")] + fn passive_shim(this: &AddEventListenerOptions, val: bool); } impl AddEventListenerOptions { #[doc = "Construct a new `AddEventListenerOptions`."] @@ -24,47 +30,21 @@ impl AddEventListenerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] pub fn capture(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("capture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.capture_shim(val); self } #[doc = "Change the `once` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] pub fn once(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("once"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.once_shim(val); self } #[doc = "Change the `passive` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] pub fn passive(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("passive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.passive_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AesCbcParams.rs b/crates/web-sys/src/features/gen_AesCbcParams.rs index 9fba20f28e5..a342b655e6a 100644 --- a/crates/web-sys/src/features/gen_AesCbcParams.rs +++ b/crates/web-sys/src/features/gen_AesCbcParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] pub type AesCbcParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AesCbcParams, val: &str); + #[wasm_bindgen(method, setter = "iv")] + fn iv_shim(this: &AesCbcParams, val: &::js_sys::Object); } impl AesCbcParams { #[doc = "Construct a new `AesCbcParams`."] @@ -26,26 +30,14 @@ impl AesCbcParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `iv` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("iv"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iv_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AesCtrParams.rs b/crates/web-sys/src/features/gen_AesCtrParams.rs index 0dbaad9e1ac..ce6270ad036 100644 --- a/crates/web-sys/src/features/gen_AesCtrParams.rs +++ b/crates/web-sys/src/features/gen_AesCtrParams.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] pub type AesCtrParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AesCtrParams, val: &str); + #[wasm_bindgen(method, setter = "counter")] + fn counter_shim(this: &AesCtrParams, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &AesCtrParams, val: u8); } impl AesCtrParams { #[doc = "Construct a new `AesCtrParams`."] @@ -27,44 +33,21 @@ impl AesCtrParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `counter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] pub fn counter(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("counter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.counter_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] pub fn length(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs b/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs index 7212fc60328..f0dc4f1e939 100644 --- a/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs +++ b/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] pub type AesDerivedKeyParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AesDerivedKeyParams, val: &str); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &AesDerivedKeyParams, val: u32); } impl AesDerivedKeyParams { #[doc = "Construct a new `AesDerivedKeyParams`."] @@ -26,27 +30,14 @@ impl AesDerivedKeyParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] pub fn length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AesGcmParams.rs b/crates/web-sys/src/features/gen_AesGcmParams.rs index 55199b0971e..13bac4af42c 100644 --- a/crates/web-sys/src/features/gen_AesGcmParams.rs +++ b/crates/web-sys/src/features/gen_AesGcmParams.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] pub type AesGcmParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AesGcmParams, val: &str); + #[wasm_bindgen(method, setter = "additionalData")] + fn additional_data_shim(this: &AesGcmParams, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "iv")] + fn iv_shim(this: &AesGcmParams, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "tagLength")] + fn tag_length_shim(this: &AesGcmParams, val: u8); } impl AesGcmParams { #[doc = "Construct a new `AesGcmParams`."] @@ -26,60 +34,28 @@ impl AesGcmParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `additionalData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] pub fn additional_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("additionalData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.additional_data_shim(val); self } #[doc = "Change the `iv` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("iv"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iv_shim(val); self } #[doc = "Change the `tagLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] pub fn tag_length(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tagLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tag_length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs b/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs index fd55a3a4cfb..b525478f622 100644 --- a/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] pub type AesKeyAlgorithm; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AesKeyAlgorithm, val: &str); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &AesKeyAlgorithm, val: u16); } impl AesKeyAlgorithm { #[doc = "Construct a new `AesKeyAlgorithm`."] @@ -26,27 +30,14 @@ impl AesKeyAlgorithm { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] pub fn length(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AesKeyGenParams.rs b/crates/web-sys/src/features/gen_AesKeyGenParams.rs index 829e6f5968b..266ae71921d 100644 --- a/crates/web-sys/src/features/gen_AesKeyGenParams.rs +++ b/crates/web-sys/src/features/gen_AesKeyGenParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] pub type AesKeyGenParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AesKeyGenParams, val: &str); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &AesKeyGenParams, val: u16); } impl AesKeyGenParams { #[doc = "Construct a new `AesKeyGenParams`."] @@ -26,27 +30,14 @@ impl AesKeyGenParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] pub fn length(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_Algorithm.rs b/crates/web-sys/src/features/gen_Algorithm.rs index 93efed89e40..3a82cd9e61e 100644 --- a/crates/web-sys/src/features/gen_Algorithm.rs +++ b/crates/web-sys/src/features/gen_Algorithm.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Algorithm`*"] pub type Algorithm; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &Algorithm, val: &str); } impl Algorithm { #[doc = "Construct a new `Algorithm`."] @@ -25,13 +27,7 @@ impl Algorithm { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Algorithm`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs index c5d76814a25..ac016920b6f 100644 --- a/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs +++ b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs @@ -14,6 +14,12 @@ 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 type AllowedBluetoothDevice; + #[wasm_bindgen(method, setter = "allowedServices")] + fn allowed_services_shim(this: &AllowedBluetoothDevice, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "deviceId")] + fn device_id_shim(this: &AllowedBluetoothDevice, val: &str); + #[wasm_bindgen(method, setter = "mayUseGATT")] + fn may_use_gatt_shim(this: &AllowedBluetoothDevice, val: bool); } #[cfg(web_sys_unstable_apis)] impl AllowedBluetoothDevice { @@ -43,17 +49,7 @@ impl AllowedBluetoothDevice { #[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 allowed_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowedServices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.allowed_services_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -64,17 +60,7 @@ impl AllowedBluetoothDevice { #[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 device_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -85,17 +71,7 @@ impl AllowedBluetoothDevice { #[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 may_use_gatt(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mayUseGATT"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.may_use_gatt_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AllowedUsbDevice.rs b/crates/web-sys/src/features/gen_AllowedUsbDevice.rs index bb47031df43..23070d3117d 100644 --- a/crates/web-sys/src/features/gen_AllowedUsbDevice.rs +++ b/crates/web-sys/src/features/gen_AllowedUsbDevice.rs @@ -14,6 +14,12 @@ 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 type AllowedUsbDevice; + #[wasm_bindgen(method, setter = "productId")] + fn product_id_shim(this: &AllowedUsbDevice, val: u8); + #[wasm_bindgen(method, setter = "serialNumber")] + fn serial_number_shim(this: &AllowedUsbDevice, val: &str); + #[wasm_bindgen(method, setter = "vendorId")] + fn vendor_id_shim(this: &AllowedUsbDevice, val: u8); } #[cfg(web_sys_unstable_apis)] impl AllowedUsbDevice { @@ -38,17 +44,7 @@ impl AllowedUsbDevice { #[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 product_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("productId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.product_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +55,7 @@ impl AllowedUsbDevice { #[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 serial_number(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serialNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.serial_number_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +66,7 @@ impl AllowedUsbDevice { #[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 vendor_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.vendor_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AnalyserOptions.rs b/crates/web-sys/src/features/gen_AnalyserOptions.rs index 48a2bf15393..776ce399d63 100644 --- a/crates/web-sys/src/features/gen_AnalyserOptions.rs +++ b/crates/web-sys/src/features/gen_AnalyserOptions.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub type AnalyserOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &AnalyserOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &AnalyserOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &AnalyserOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "fftSize")] + fn fft_size_shim(this: &AnalyserOptions, val: u32); + #[wasm_bindgen(method, setter = "maxDecibels")] + fn max_decibels_shim(this: &AnalyserOptions, val: f64); + #[wasm_bindgen(method, setter = "minDecibels")] + fn min_decibels_shim(this: &AnalyserOptions, val: f64); + #[wasm_bindgen(method, setter = "smoothingTimeConstant")] + fn smoothing_time_constant_shim(this: &AnalyserOptions, val: f64); } impl AnalyserOptions { #[doc = "Construct a new `AnalyserOptions`."] @@ -24,17 +40,7 @@ impl AnalyserOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +48,7 @@ impl AnalyserOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`, `ChannelCountMode`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,85 +56,35 @@ impl AnalyserOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`, `ChannelInterpretation`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `fftSize` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub fn fft_size(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fftSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fft_size_shim(val); self } #[doc = "Change the `maxDecibels` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub fn max_decibels(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDecibels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_decibels_shim(val); self } #[doc = "Change the `minDecibels` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub fn min_decibels(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minDecibels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_decibels_shim(val); self } #[doc = "Change the `smoothingTimeConstant` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub fn smoothing_time_constant(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("smoothingTimeConstant"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.smoothing_time_constant_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationEventInit.rs b/crates/web-sys/src/features/gen_AnimationEventInit.rs index 2d83b6eec70..49910c05af7 100644 --- a/crates/web-sys/src/features/gen_AnimationEventInit.rs +++ b/crates/web-sys/src/features/gen_AnimationEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub type AnimationEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &AnimationEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &AnimationEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &AnimationEventInit, val: bool); + #[wasm_bindgen(method, setter = "animationName")] + fn animation_name_shim(this: &AnimationEventInit, val: &str); + #[wasm_bindgen(method, setter = "elapsedTime")] + fn elapsed_time_shim(this: &AnimationEventInit, val: f32); + #[wasm_bindgen(method, setter = "pseudoElement")] + fn pseudo_element_shim(this: &AnimationEventInit, val: &str); } impl AnimationEventInit { #[doc = "Construct a new `AnimationEventInit`."] @@ -24,102 +36,42 @@ impl AnimationEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `animationName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub fn animation_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("animationName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.animation_name_shim(val); self } #[doc = "Change the `elapsedTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub fn elapsed_time(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("elapsedTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.elapsed_time_shim(val); self } #[doc = "Change the `pseudoElement` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub fn pseudo_element(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pseudoElement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pseudo_element_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs b/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs index 4b6b8f99f04..de0898ed513 100644 --- a/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs +++ b/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub type AnimationPlaybackEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &AnimationPlaybackEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &AnimationPlaybackEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &AnimationPlaybackEventInit, val: bool); + #[wasm_bindgen(method, setter = "currentTime")] + fn current_time_shim(this: &AnimationPlaybackEventInit, val: Option); + #[wasm_bindgen(method, setter = "timelineTime")] + fn timeline_time_shim(this: &AnimationPlaybackEventInit, val: Option); } impl AnimationPlaybackEventInit { #[doc = "Construct a new `AnimationPlaybackEventInit`."] @@ -24,85 +34,35 @@ impl AnimationPlaybackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `currentTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub fn current_time(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("currentTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.current_time_shim(val); self } #[doc = "Change the `timelineTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub fn timeline_time(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timelineTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timeline_time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs b/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs index 05280ee164c..8b9e529af90 100644 --- a/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs +++ b/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] pub type AnimationPropertyDetails; + #[wasm_bindgen(method, setter = "property")] + fn property_shim(this: &AnimationPropertyDetails, val: &str); + #[wasm_bindgen(method, setter = "runningOnCompositor")] + fn running_on_compositor_shim(this: &AnimationPropertyDetails, val: bool); + #[wasm_bindgen(method, setter = "values")] + fn values_shim(this: &AnimationPropertyDetails, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "warning")] + fn warning_shim(this: &AnimationPropertyDetails, val: &str); } impl AnimationPropertyDetails { #[doc = "Construct a new `AnimationPropertyDetails`."] @@ -31,65 +39,28 @@ impl AnimationPropertyDetails { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] pub fn property(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("property"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.property_shim(val); self } #[doc = "Change the `runningOnCompositor` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] pub fn running_on_compositor(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("runningOnCompositor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.running_on_compositor_shim(val); self } #[doc = "Change the `values` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] pub fn values(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("values"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.values_shim(val); self } #[doc = "Change the `warning` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] pub fn warning(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("warning"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.warning_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs b/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs index 6d96f622312..28ace13608c 100644 --- a/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs +++ b/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] pub type AnimationPropertyValueDetails; + #[cfg(feature = "CompositeOperation")] + #[wasm_bindgen(method, setter = "composite")] + fn composite_shim(this: &AnimationPropertyValueDetails, val: CompositeOperation); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &AnimationPropertyValueDetails, val: &str); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &AnimationPropertyValueDetails, val: f64); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &AnimationPropertyValueDetails, val: &str); } impl AnimationPropertyValueDetails { #[cfg(feature = "CompositeOperation")] @@ -28,58 +37,28 @@ impl AnimationPropertyValueDetails { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`, `CompositeOperation`*"] pub fn composite(&mut self, val: CompositeOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composite_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `offset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] pub fn offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] pub fn value(&mut self, val: &str) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AssignedNodesOptions.rs b/crates/web-sys/src/features/gen_AssignedNodesOptions.rs index 6c2b66d1e03..45eba715538 100644 --- a/crates/web-sys/src/features/gen_AssignedNodesOptions.rs +++ b/crates/web-sys/src/features/gen_AssignedNodesOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"] pub type AssignedNodesOptions; + #[wasm_bindgen(method, setter = "flatten")] + fn flatten_shim(this: &AssignedNodesOptions, val: bool); } impl AssignedNodesOptions { #[doc = "Construct a new `AssignedNodesOptions`."] @@ -24,17 +26,7 @@ impl AssignedNodesOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"] pub fn flatten(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("flatten"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.flatten_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AttributeNameValue.rs b/crates/web-sys/src/features/gen_AttributeNameValue.rs index 1f614d1d64c..46535ab0223 100644 --- a/crates/web-sys/src/features/gen_AttributeNameValue.rs +++ b/crates/web-sys/src/features/gen_AttributeNameValue.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] pub type AttributeNameValue; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &AttributeNameValue, val: &str); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &AttributeNameValue, val: &str); } impl AttributeNameValue { #[doc = "Construct a new `AttributeNameValue`."] @@ -26,26 +30,14 @@ impl AttributeNameValue { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] pub fn value(&mut self, val: &str) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioBufferOptions.rs b/crates/web-sys/src/features/gen_AudioBufferOptions.rs index 7cb81321581..b3f905927bf 100644 --- a/crates/web-sys/src/features/gen_AudioBufferOptions.rs +++ b/crates/web-sys/src/features/gen_AudioBufferOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] pub type AudioBufferOptions; + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &AudioBufferOptions, val: u32); + #[wasm_bindgen(method, setter = "numberOfChannels")] + fn number_of_channels_shim(this: &AudioBufferOptions, val: u32); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &AudioBufferOptions, val: f32); } impl AudioBufferOptions { #[doc = "Construct a new `AudioBufferOptions`."] @@ -26,48 +32,21 @@ impl AudioBufferOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] pub fn length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } #[doc = "Change the `numberOfChannels` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] pub fn number_of_channels(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfChannels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_channels_shim(val); self } #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] pub fn sample_rate(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs b/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs index ff42b5066c0..5da87254d67 100644 --- a/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs +++ b/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub type AudioBufferSourceOptions; + #[cfg(feature = "AudioBuffer")] + #[wasm_bindgen(method, setter = "buffer")] + fn buffer_shim(this: &AudioBufferSourceOptions, val: Option<&AudioBuffer>); + #[wasm_bindgen(method, setter = "detune")] + fn detune_shim(this: &AudioBufferSourceOptions, val: f32); + #[wasm_bindgen(method, setter = "loop")] + fn loop__shim(this: &AudioBufferSourceOptions, val: bool); + #[wasm_bindgen(method, setter = "loopEnd")] + fn loop_end_shim(this: &AudioBufferSourceOptions, val: f64); + #[wasm_bindgen(method, setter = "loopStart")] + fn loop_start_shim(this: &AudioBufferSourceOptions, val: f64); + #[wasm_bindgen(method, setter = "playbackRate")] + fn playback_rate_shim(this: &AudioBufferSourceOptions, val: f32); } impl AudioBufferSourceOptions { #[doc = "Construct a new `AudioBufferSourceOptions`."] @@ -25,92 +38,42 @@ impl AudioBufferSourceOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceOptions`*"] pub fn buffer(&mut self, val: Option<&AudioBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffer_shim(val); self } #[doc = "Change the `detune` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub fn detune(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detune"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detune_shim(val); self } #[doc = "Change the `loop` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub fn loop_(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loop"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.loop__shim(val); self } #[doc = "Change the `loopEnd` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub fn loop_end(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("loopEnd"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.loop_end_shim(val); self } #[doc = "Change the `loopStart` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub fn loop_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("loopStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.loop_start_shim(val); self } #[doc = "Change the `playbackRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub fn playback_rate(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("playbackRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.playback_rate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioConfiguration.rs b/crates/web-sys/src/features/gen_AudioConfiguration.rs index 9d6347dee31..058667594ce 100644 --- a/crates/web-sys/src/features/gen_AudioConfiguration.rs +++ b/crates/web-sys/src/features/gen_AudioConfiguration.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] pub type AudioConfiguration; + #[wasm_bindgen(method, setter = "bitrate")] + fn bitrate_shim(this: &AudioConfiguration, val: f64); + #[wasm_bindgen(method, setter = "channels")] + fn channels_shim(this: &AudioConfiguration, val: &str); + #[wasm_bindgen(method, setter = "contentType")] + fn content_type_shim(this: &AudioConfiguration, val: &str); + #[wasm_bindgen(method, setter = "samplerate")] + fn samplerate_shim(this: &AudioConfiguration, val: u32); } impl AudioConfiguration { #[doc = "Construct a new `AudioConfiguration`."] @@ -24,68 +32,28 @@ impl AudioConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] pub fn bitrate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_shim(val); self } #[doc = "Change the `channels` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] pub fn channels(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channels_shim(val); self } #[doc = "Change the `contentType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] pub fn content_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contentType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.content_type_shim(val); self } #[doc = "Change the `samplerate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] pub fn samplerate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("samplerate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.samplerate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioContextOptions.rs b/crates/web-sys/src/features/gen_AudioContextOptions.rs index 56dbb0a4cae..85b9ffaa010 100644 --- a/crates/web-sys/src/features/gen_AudioContextOptions.rs +++ b/crates/web-sys/src/features/gen_AudioContextOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] pub type AudioContextOptions; + #[wasm_bindgen(method, setter = "latencyHint")] + fn latency_hint_shim(this: &AudioContextOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &AudioContextOptions, val: f32); + #[wasm_bindgen(method, setter = "sinkId")] + fn sink_id_shim(this: &AudioContextOptions, val: &::wasm_bindgen::JsValue); } impl AudioContextOptions { #[doc = "Construct a new `AudioContextOptions`."] @@ -24,34 +30,14 @@ impl AudioContextOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] pub fn latency_hint(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("latencyHint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.latency_hint_shim(val); self } #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] pub fn sample_rate(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -62,14 +48,7 @@ impl AudioContextOptions { #[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 sink_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sinkId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sink_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs b/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs index 2d3132cbaac..b7fb5f2426a 100644 --- a/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs +++ b/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs @@ -14,6 +14,15 @@ 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 type AudioDataCopyToOptions; + #[cfg(feature = "AudioSampleFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &AudioDataCopyToOptions, val: AudioSampleFormat); + #[wasm_bindgen(method, setter = "frameCount")] + fn frame_count_shim(this: &AudioDataCopyToOptions, val: u32); + #[wasm_bindgen(method, setter = "frameOffset")] + fn frame_offset_shim(this: &AudioDataCopyToOptions, val: u32); + #[wasm_bindgen(method, setter = "planeIndex")] + fn plane_index_shim(this: &AudioDataCopyToOptions, val: u32); } #[cfg(web_sys_unstable_apis)] impl AudioDataCopyToOptions { @@ -38,14 +47,7 @@ impl AudioDataCopyToOptions { #[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 format(&mut self, val: AudioSampleFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,17 +58,7 @@ impl AudioDataCopyToOptions { #[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 frame_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +69,7 @@ impl AudioDataCopyToOptions { #[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 frame_offset(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -98,17 +80,7 @@ impl AudioDataCopyToOptions { #[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 plane_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("planeIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.plane_index_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDataInit.rs b/crates/web-sys/src/features/gen_AudioDataInit.rs index de51e8380a0..88afffc7932 100644 --- a/crates/web-sys/src/features/gen_AudioDataInit.rs +++ b/crates/web-sys/src/features/gen_AudioDataInit.rs @@ -14,6 +14,19 @@ 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 type AudioDataInit; + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &AudioDataInit, val: &::js_sys::Object); + #[cfg(feature = "AudioSampleFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &AudioDataInit, val: AudioSampleFormat); + #[wasm_bindgen(method, setter = "numberOfChannels")] + fn number_of_channels_shim(this: &AudioDataInit, val: u32); + #[wasm_bindgen(method, setter = "numberOfFrames")] + fn number_of_frames_shim(this: &AudioDataInit, val: u32); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &AudioDataInit, val: f32); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &AudioDataInit, val: f64); } #[cfg(web_sys_unstable_apis)] impl AudioDataInit { @@ -50,13 +63,7 @@ impl AudioDataInit { #[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 data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -68,14 +75,7 @@ impl AudioDataInit { #[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 format(&mut self, val: AudioSampleFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -86,17 +86,7 @@ impl AudioDataInit { #[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 number_of_channels(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfChannels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_channels_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -107,17 +97,7 @@ impl AudioDataInit { #[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 number_of_frames(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfFrames"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_frames_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -128,17 +108,7 @@ impl AudioDataInit { #[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 sample_rate(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -149,17 +119,7 @@ impl AudioDataInit { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDecoderConfig.rs b/crates/web-sys/src/features/gen_AudioDecoderConfig.rs index 83414175881..561f6c58664 100644 --- a/crates/web-sys/src/features/gen_AudioDecoderConfig.rs +++ b/crates/web-sys/src/features/gen_AudioDecoderConfig.rs @@ -14,6 +14,14 @@ 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 type AudioDecoderConfig; + #[wasm_bindgen(method, setter = "codec")] + fn codec_shim(this: &AudioDecoderConfig, val: &str); + #[wasm_bindgen(method, setter = "description")] + fn description_shim(this: &AudioDecoderConfig, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "numberOfChannels")] + fn number_of_channels_shim(this: &AudioDecoderConfig, val: u32); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &AudioDecoderConfig, val: u32); } #[cfg(web_sys_unstable_apis)] impl AudioDecoderConfig { @@ -39,13 +47,7 @@ impl AudioDecoderConfig { #[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 codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,17 +58,7 @@ impl AudioDecoderConfig { #[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 description(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.description_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +69,7 @@ impl AudioDecoderConfig { #[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 number_of_channels(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfChannels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_channels_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -98,17 +80,7 @@ impl AudioDecoderConfig { #[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 sample_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDecoderInit.rs b/crates/web-sys/src/features/gen_AudioDecoderInit.rs index f1ee1a6017b..927ec60a7f9 100644 --- a/crates/web-sys/src/features/gen_AudioDecoderInit.rs +++ b/crates/web-sys/src/features/gen_AudioDecoderInit.rs @@ -14,6 +14,10 @@ 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 type AudioDecoderInit; + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &AudioDecoderInit, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "output")] + fn output_shim(this: &AudioDecoderInit, val: &::js_sys::Function); } #[cfg(web_sys_unstable_apis)] impl AudioDecoderInit { @@ -38,13 +42,7 @@ impl AudioDecoderInit { #[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 error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,14 +53,7 @@ impl AudioDecoderInit { #[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 output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.output_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDecoderSupport.rs b/crates/web-sys/src/features/gen_AudioDecoderSupport.rs index 2f4b969fd10..ecbbc3eed95 100644 --- a/crates/web-sys/src/features/gen_AudioDecoderSupport.rs +++ b/crates/web-sys/src/features/gen_AudioDecoderSupport.rs @@ -14,6 +14,11 @@ 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 type AudioDecoderSupport; + #[cfg(feature = "AudioDecoderConfig")] + #[wasm_bindgen(method, setter = "config")] + fn config_shim(this: &AudioDecoderSupport, val: &AudioDecoderConfig); + #[wasm_bindgen(method, setter = "supported")] + fn supported_shim(this: &AudioDecoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl AudioDecoderSupport { @@ -37,14 +42,7 @@ impl AudioDecoderSupport { #[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 config(&mut self, val: &AudioDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.config_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,17 +53,7 @@ impl AudioDecoderSupport { #[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 supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.supported_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioEncoderConfig.rs b/crates/web-sys/src/features/gen_AudioEncoderConfig.rs index 5cc365558c2..a21f98ad4da 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderConfig.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderConfig.rs @@ -14,6 +14,14 @@ 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 type AudioEncoderConfig; + #[wasm_bindgen(method, setter = "bitrate")] + fn bitrate_shim(this: &AudioEncoderConfig, val: f64); + #[wasm_bindgen(method, setter = "codec")] + fn codec_shim(this: &AudioEncoderConfig, val: &str); + #[wasm_bindgen(method, setter = "numberOfChannels")] + fn number_of_channels_shim(this: &AudioEncoderConfig, val: u32); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &AudioEncoderConfig, val: u32); } #[cfg(web_sys_unstable_apis)] impl AudioEncoderConfig { @@ -37,17 +45,7 @@ impl AudioEncoderConfig { #[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 bitrate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,13 +56,7 @@ impl AudioEncoderConfig { #[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 codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +67,7 @@ impl AudioEncoderConfig { #[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 number_of_channels(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfChannels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_channels_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -96,17 +78,7 @@ impl AudioEncoderConfig { #[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 sample_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioEncoderInit.rs b/crates/web-sys/src/features/gen_AudioEncoderInit.rs index 074512257e3..52bae3763d0 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderInit.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderInit.rs @@ -14,6 +14,10 @@ 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 type AudioEncoderInit; + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &AudioEncoderInit, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "output")] + fn output_shim(this: &AudioEncoderInit, val: &::js_sys::Function); } #[cfg(web_sys_unstable_apis)] impl AudioEncoderInit { @@ -38,13 +42,7 @@ impl AudioEncoderInit { #[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 error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,14 +53,7 @@ impl AudioEncoderInit { #[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 output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.output_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioEncoderSupport.rs b/crates/web-sys/src/features/gen_AudioEncoderSupport.rs index 1ca54d133db..c19fad1e944 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderSupport.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderSupport.rs @@ -14,6 +14,11 @@ 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 type AudioEncoderSupport; + #[cfg(feature = "AudioEncoderConfig")] + #[wasm_bindgen(method, setter = "config")] + fn config_shim(this: &AudioEncoderSupport, val: &AudioEncoderConfig); + #[wasm_bindgen(method, setter = "supported")] + fn supported_shim(this: &AudioEncoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl AudioEncoderSupport { @@ -37,14 +42,7 @@ impl AudioEncoderSupport { #[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 config(&mut self, val: &AudioEncoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.config_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,17 +53,7 @@ impl AudioEncoderSupport { #[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 supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.supported_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioNodeOptions.rs b/crates/web-sys/src/features/gen_AudioNodeOptions.rs index 369aba788f1..a5baf5de084 100644 --- a/crates/web-sys/src/features/gen_AudioNodeOptions.rs +++ b/crates/web-sys/src/features/gen_AudioNodeOptions.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"] pub type AudioNodeOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &AudioNodeOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &AudioNodeOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &AudioNodeOptions, val: ChannelInterpretation); } impl AudioNodeOptions { #[doc = "Construct a new `AudioNodeOptions`."] @@ -24,17 +32,7 @@ impl AudioNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +40,7 @@ impl AudioNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`, `ChannelCountMode`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,17 +48,7 @@ impl AudioNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`, `ChannelInterpretation`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioSinkOptions.rs b/crates/web-sys/src/features/gen_AudioSinkOptions.rs index 5e264767db0..666dd222b52 100644 --- a/crates/web-sys/src/features/gen_AudioSinkOptions.rs +++ b/crates/web-sys/src/features/gen_AudioSinkOptions.rs @@ -14,6 +14,9 @@ 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 type AudioSinkOptions; + #[cfg(feature = "AudioSinkType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &AudioSinkOptions, val: AudioSinkType); } #[cfg(web_sys_unstable_apis)] impl AudioSinkOptions { @@ -39,13 +42,7 @@ impl AudioSinkOptions { #[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 type_(&mut self, val: AudioSinkType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs b/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs index 99db4aa1d64..4d683ce3c00 100644 --- a/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs +++ b/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub type AudioWorkletNodeOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &AudioWorkletNodeOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &AudioWorkletNodeOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &AudioWorkletNodeOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "numberOfInputs")] + fn number_of_inputs_shim(this: &AudioWorkletNodeOptions, val: u32); + #[wasm_bindgen(method, setter = "numberOfOutputs")] + fn number_of_outputs_shim(this: &AudioWorkletNodeOptions, val: u32); + #[wasm_bindgen(method, setter = "outputChannelCount")] + fn output_channel_count_shim(this: &AudioWorkletNodeOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "processorOptions")] + fn processor_options_shim(this: &AudioWorkletNodeOptions, val: Option<&::js_sys::Object>); } impl AudioWorkletNodeOptions { #[doc = "Construct a new `AudioWorkletNodeOptions`."] @@ -24,17 +40,7 @@ impl AudioWorkletNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +48,7 @@ impl AudioWorkletNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `ChannelCountMode`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,85 +56,35 @@ impl AudioWorkletNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `ChannelInterpretation`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `numberOfInputs` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub fn number_of_inputs(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfInputs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_inputs_shim(val); self } #[doc = "Change the `numberOfOutputs` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub fn number_of_outputs(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfOutputs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_outputs_shim(val); self } #[doc = "Change the `outputChannelCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub fn output_channel_count(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("outputChannelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.output_channel_count_shim(val); self } #[doc = "Change the `processorOptions` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub fn processor_options(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("processorOptions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.processor_options_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs index 24237c5bbf4..954af0d7237 100644 --- a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] pub type AuthenticationExtensionsClientInputs; + #[wasm_bindgen(method, setter = "appid")] + fn appid_shim(this: &AuthenticationExtensionsClientInputs, val: &str); } impl AuthenticationExtensionsClientInputs { #[doc = "Construct a new `AuthenticationExtensionsClientInputs`."] @@ -24,13 +26,7 @@ impl AuthenticationExtensionsClientInputs { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] pub fn appid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("appid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.appid_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs index e2e038654fe..9b63b43d5df 100644 --- a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] pub type AuthenticationExtensionsClientOutputs; + #[wasm_bindgen(method, setter = "appid")] + fn appid_shim(this: &AuthenticationExtensionsClientOutputs, val: bool); } impl AuthenticationExtensionsClientOutputs { #[doc = "Construct a new `AuthenticationExtensionsClientOutputs`."] @@ -24,13 +26,7 @@ impl AuthenticationExtensionsClientOutputs { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] pub fn appid(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("appid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.appid_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs b/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs index a7bc5c5ab93..4ebf1beed46 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] pub type AuthenticatorSelectionCriteria; + #[cfg(feature = "AuthenticatorAttachment")] + #[wasm_bindgen(method, setter = "authenticatorAttachment")] + fn authenticator_attachment_shim( + this: &AuthenticatorSelectionCriteria, + val: AuthenticatorAttachment, + ); + #[wasm_bindgen(method, setter = "requireResidentKey")] + fn require_resident_key_shim(this: &AuthenticatorSelectionCriteria, val: bool); + #[cfg(feature = "UserVerificationRequirement")] + #[wasm_bindgen(method, setter = "userVerification")] + fn user_verification_shim( + this: &AuthenticatorSelectionCriteria, + val: UserVerificationRequirement, + ); } impl AuthenticatorSelectionCriteria { #[doc = "Construct a new `AuthenticatorSelectionCriteria`."] @@ -25,34 +39,14 @@ impl AuthenticatorSelectionCriteria { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`, `AuthenticatorSelectionCriteria`*"] pub fn authenticator_attachment(&mut self, val: AuthenticatorAttachment) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("authenticatorAttachment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.authenticator_attachment_shim(val); self } #[doc = "Change the `requireResidentKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] pub fn require_resident_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requireResidentKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.require_resident_key_shim(val); self } #[cfg(feature = "UserVerificationRequirement")] @@ -60,17 +54,7 @@ impl AuthenticatorSelectionCriteria { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `UserVerificationRequirement`*"] pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("userVerification"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.user_verification_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_AutocompleteInfo.rs b/crates/web-sys/src/features/gen_AutocompleteInfo.rs index a87e5213e96..fbc62528fb1 100644 --- a/crates/web-sys/src/features/gen_AutocompleteInfo.rs +++ b/crates/web-sys/src/features/gen_AutocompleteInfo.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] pub type AutocompleteInfo; + #[wasm_bindgen(method, setter = "addressType")] + fn address_type_shim(this: &AutocompleteInfo, val: &str); + #[wasm_bindgen(method, setter = "contactType")] + fn contact_type_shim(this: &AutocompleteInfo, val: &str); + #[wasm_bindgen(method, setter = "fieldName")] + fn field_name_shim(this: &AutocompleteInfo, val: &str); + #[wasm_bindgen(method, setter = "section")] + fn section_shim(this: &AutocompleteInfo, val: &str); } impl AutocompleteInfo { #[doc = "Construct a new `AutocompleteInfo`."] @@ -24,68 +32,28 @@ impl AutocompleteInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] pub fn address_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.address_type_shim(val); self } #[doc = "Change the `contactType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] pub fn contact_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contactType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.contact_type_shim(val); self } #[doc = "Change the `fieldName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] pub fn field_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fieldName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.field_name_shim(val); self } #[doc = "Change the `section` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] pub fn section(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("section"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.section_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs b/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs index 8a91e92ff24..073a7138836 100644 --- a/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs +++ b/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] pub type BaseComputedKeyframe; + #[cfg(feature = "CompositeOperation")] + #[wasm_bindgen(method, setter = "composite")] + fn composite_shim(this: &BaseComputedKeyframe, val: Option); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &BaseComputedKeyframe, val: &str); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &BaseComputedKeyframe, val: Option); + #[wasm_bindgen(method, setter = "simulateComputeValuesFailure")] + fn simulate_compute_values_failure_shim(this: &BaseComputedKeyframe, val: bool); + #[wasm_bindgen(method, setter = "computedOffset")] + fn computed_offset_shim(this: &BaseComputedKeyframe, val: f64); } impl BaseComputedKeyframe { #[doc = "Construct a new `BaseComputedKeyframe`."] @@ -25,79 +36,35 @@ impl BaseComputedKeyframe { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`, `CompositeOperation`*"] pub fn composite(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composite_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `offset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] pub fn offset(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[doc = "Change the `simulateComputeValuesFailure` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] pub fn simulate_compute_values_failure(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("simulateComputeValuesFailure"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.simulate_compute_values_failure_shim(val); self } #[doc = "Change the `computedOffset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] pub fn computed_offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("computedOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.computed_offset_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BaseKeyframe.rs b/crates/web-sys/src/features/gen_BaseKeyframe.rs index 692a8fc2863..0c2f97da2aa 100644 --- a/crates/web-sys/src/features/gen_BaseKeyframe.rs +++ b/crates/web-sys/src/features/gen_BaseKeyframe.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] pub type BaseKeyframe; + #[cfg(feature = "CompositeOperation")] + #[wasm_bindgen(method, setter = "composite")] + fn composite_shim(this: &BaseKeyframe, val: Option); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &BaseKeyframe, val: &str); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &BaseKeyframe, val: Option); + #[wasm_bindgen(method, setter = "simulateComputeValuesFailure")] + fn simulate_compute_values_failure_shim(this: &BaseKeyframe, val: bool); } impl BaseKeyframe { #[doc = "Construct a new `BaseKeyframe`."] @@ -25,62 +34,28 @@ impl BaseKeyframe { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`, `CompositeOperation`*"] pub fn composite(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composite_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `offset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] pub fn offset(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[doc = "Change the `simulateComputeValuesFailure` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] pub fn simulate_compute_values_failure(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("simulateComputeValuesFailure"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.simulate_compute_values_failure_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs b/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs index 38eebc98161..d2dfb18f80e 100644 --- a/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs +++ b/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] pub type BasePropertyIndexedKeyframe; + #[wasm_bindgen(method, setter = "composite")] + fn composite_shim(this: &BasePropertyIndexedKeyframe, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &BasePropertyIndexedKeyframe, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &BasePropertyIndexedKeyframe, val: &::wasm_bindgen::JsValue); } impl BasePropertyIndexedKeyframe { #[doc = "Construct a new `BasePropertyIndexedKeyframe`."] @@ -24,45 +30,21 @@ impl BasePropertyIndexedKeyframe { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] pub fn composite(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composite_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] pub fn easing(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `offset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] pub fn offset(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BasicCardRequest.rs b/crates/web-sys/src/features/gen_BasicCardRequest.rs index 6b029a46b90..4509a71d546 100644 --- a/crates/web-sys/src/features/gen_BasicCardRequest.rs +++ b/crates/web-sys/src/features/gen_BasicCardRequest.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] pub type BasicCardRequest; + #[wasm_bindgen(method, setter = "supportedNetworks")] + fn supported_networks_shim(this: &BasicCardRequest, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "supportedTypes")] + fn supported_types_shim(this: &BasicCardRequest, val: &::wasm_bindgen::JsValue); } impl BasicCardRequest { #[doc = "Construct a new `BasicCardRequest`."] @@ -24,34 +28,14 @@ impl BasicCardRequest { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] pub fn supported_networks(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supportedNetworks"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.supported_networks_shim(val); self } #[doc = "Change the `supportedTypes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] pub fn supported_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supportedTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.supported_types_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BasicCardResponse.rs b/crates/web-sys/src/features/gen_BasicCardResponse.rs index 1341341abab..bafff97512c 100644 --- a/crates/web-sys/src/features/gen_BasicCardResponse.rs +++ b/crates/web-sys/src/features/gen_BasicCardResponse.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub type BasicCardResponse; + #[cfg(feature = "PaymentAddress")] + #[wasm_bindgen(method, setter = "billingAddress")] + fn billing_address_shim(this: &BasicCardResponse, val: Option<&PaymentAddress>); + #[wasm_bindgen(method, setter = "cardNumber")] + fn card_number_shim(this: &BasicCardResponse, val: &str); + #[wasm_bindgen(method, setter = "cardSecurityCode")] + fn card_security_code_shim(this: &BasicCardResponse, val: &str); + #[wasm_bindgen(method, setter = "cardholderName")] + fn cardholder_name_shim(this: &BasicCardResponse, val: &str); + #[wasm_bindgen(method, setter = "expiryMonth")] + fn expiry_month_shim(this: &BasicCardResponse, val: &str); + #[wasm_bindgen(method, setter = "expiryYear")] + fn expiry_year_shim(this: &BasicCardResponse, val: &str); } impl BasicCardResponse { #[doc = "Construct a new `BasicCardResponse`."] @@ -26,102 +39,42 @@ impl BasicCardResponse { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`, `PaymentAddress`*"] pub fn billing_address(&mut self, val: Option<&PaymentAddress>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("billingAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.billing_address_shim(val); self } #[doc = "Change the `cardNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub fn card_number(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cardNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.card_number_shim(val); self } #[doc = "Change the `cardSecurityCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub fn card_security_code(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cardSecurityCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.card_security_code_shim(val); self } #[doc = "Change the `cardholderName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub fn cardholder_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cardholderName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cardholder_name_shim(val); self } #[doc = "Change the `expiryMonth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub fn expiry_month(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expiryMonth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.expiry_month_shim(val); self } #[doc = "Change the `expiryYear` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub fn expiry_year(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expiryYear"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.expiry_year_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BiquadFilterOptions.rs b/crates/web-sys/src/features/gen_BiquadFilterOptions.rs index d8a4af290f0..6a0863aa344 100644 --- a/crates/web-sys/src/features/gen_BiquadFilterOptions.rs +++ b/crates/web-sys/src/features/gen_BiquadFilterOptions.rs @@ -10,6 +10,25 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub type BiquadFilterOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &BiquadFilterOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &BiquadFilterOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &BiquadFilterOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "Q")] + fn q_shim(this: &BiquadFilterOptions, val: f32); + #[wasm_bindgen(method, setter = "detune")] + fn detune_shim(this: &BiquadFilterOptions, val: f32); + #[wasm_bindgen(method, setter = "frequency")] + fn frequency_shim(this: &BiquadFilterOptions, val: f32); + #[wasm_bindgen(method, setter = "gain")] + fn gain_shim(this: &BiquadFilterOptions, val: f32); + #[cfg(feature = "BiquadFilterType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &BiquadFilterOptions, val: BiquadFilterType); } impl BiquadFilterOptions { #[doc = "Construct a new `BiquadFilterOptions`."] @@ -24,17 +43,7 @@ impl BiquadFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +51,7 @@ impl BiquadFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `ChannelCountMode`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,74 +59,35 @@ impl BiquadFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `ChannelInterpretation`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `Q` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub fn q(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("Q"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.q_shim(val); self } #[doc = "Change the `detune` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub fn detune(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detune"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detune_shim(val); self } #[doc = "Change the `frequency` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub fn frequency(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frequency"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frequency_shim(val); self } #[doc = "Change the `gain` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub fn gain(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gain"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gain_shim(val); self } #[cfg(feature = "BiquadFilterType")] @@ -135,13 +95,7 @@ impl BiquadFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `BiquadFilterType`*"] pub fn type_(&mut self, val: BiquadFilterType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BlobEventInit.rs b/crates/web-sys/src/features/gen_BlobEventInit.rs index 5abb9a6fba5..0fa75a06fb3 100644 --- a/crates/web-sys/src/features/gen_BlobEventInit.rs +++ b/crates/web-sys/src/features/gen_BlobEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] pub type BlobEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &BlobEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &BlobEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &BlobEventInit, val: bool); + #[cfg(feature = "Blob")] + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &BlobEventInit, val: Option<&Blob>); } impl BlobEventInit { #[doc = "Construct a new `BlobEventInit`."] @@ -24,51 +33,21 @@ impl BlobEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Blob")] @@ -76,13 +55,7 @@ impl BlobEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobEventInit`*"] pub fn data(&mut self, val: Option<&Blob>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BlobPropertyBag.rs b/crates/web-sys/src/features/gen_BlobPropertyBag.rs index 80cf07ead92..0adf9be4ac0 100644 --- a/crates/web-sys/src/features/gen_BlobPropertyBag.rs +++ b/crates/web-sys/src/features/gen_BlobPropertyBag.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"] pub type BlobPropertyBag; + #[cfg(feature = "EndingTypes")] + #[wasm_bindgen(method, setter = "endings")] + fn endings_shim(this: &BlobPropertyBag, val: EndingTypes); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &BlobPropertyBag, val: &str); } impl BlobPropertyBag { #[doc = "Construct a new `BlobPropertyBag`."] @@ -25,30 +30,14 @@ impl BlobPropertyBag { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`, `EndingTypes`*"] pub fn endings(&mut self, val: EndingTypes) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.endings_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BlockParsingOptions.rs b/crates/web-sys/src/features/gen_BlockParsingOptions.rs index f12f036962a..f46a8c184bc 100644 --- a/crates/web-sys/src/features/gen_BlockParsingOptions.rs +++ b/crates/web-sys/src/features/gen_BlockParsingOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"] pub type BlockParsingOptions; + #[wasm_bindgen(method, setter = "blockScriptCreated")] + fn block_script_created_shim(this: &BlockParsingOptions, val: bool); } impl BlockParsingOptions { #[doc = "Construct a new `BlockParsingOptions`."] @@ -24,17 +26,7 @@ impl BlockParsingOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"] pub fn block_script_created(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("blockScriptCreated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.block_script_created_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs index 4a1bf8b5e24..3b357d47883 100644 --- a/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs @@ -14,6 +14,34 @@ 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 type BluetoothAdvertisingEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &BluetoothAdvertisingEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &BluetoothAdvertisingEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &BluetoothAdvertisingEventInit, val: bool); + #[wasm_bindgen(method, setter = "appearance")] + fn appearance_shim(this: &BluetoothAdvertisingEventInit, val: u16); + #[cfg(feature = "BluetoothDevice")] + #[wasm_bindgen(method, setter = "device")] + fn device_shim(this: &BluetoothAdvertisingEventInit, val: &BluetoothDevice); + #[cfg(feature = "BluetoothManufacturerDataMap")] + #[wasm_bindgen(method, setter = "manufacturerData")] + fn manufacturer_data_shim( + this: &BluetoothAdvertisingEventInit, + val: &BluetoothManufacturerDataMap, + ); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &BluetoothAdvertisingEventInit, val: &str); + #[wasm_bindgen(method, setter = "rssi")] + fn rssi_shim(this: &BluetoothAdvertisingEventInit, val: i8); + #[cfg(feature = "BluetoothServiceDataMap")] + #[wasm_bindgen(method, setter = "serviceData")] + fn service_data_shim(this: &BluetoothAdvertisingEventInit, val: &BluetoothServiceDataMap); + #[wasm_bindgen(method, setter = "txPower")] + fn tx_power_shim(this: &BluetoothAdvertisingEventInit, val: i8); + #[wasm_bindgen(method, setter = "uuids")] + fn uuids_shim(this: &BluetoothAdvertisingEventInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl BluetoothAdvertisingEventInit { @@ -38,17 +66,7 @@ impl BluetoothAdvertisingEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +77,7 @@ impl BluetoothAdvertisingEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +88,7 @@ impl BluetoothAdvertisingEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -101,17 +99,7 @@ impl BluetoothAdvertisingEventInit { #[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 appearance(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("appearance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.appearance_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -123,14 +111,7 @@ impl BluetoothAdvertisingEventInit { #[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 device(&mut self, val: &BluetoothDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -142,17 +123,7 @@ impl BluetoothAdvertisingEventInit { #[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 manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("manufacturerData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.manufacturer_data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -163,13 +134,7 @@ impl BluetoothAdvertisingEventInit { #[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 name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -180,13 +145,7 @@ impl BluetoothAdvertisingEventInit { #[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 rssi(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rssi"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rssi_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -198,17 +157,7 @@ impl BluetoothAdvertisingEventInit { #[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 service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serviceData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.service_data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -219,17 +168,7 @@ impl BluetoothAdvertisingEventInit { #[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 tx_power(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("txPower"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tx_power_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -240,13 +179,7 @@ impl BluetoothAdvertisingEventInit { #[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 uuids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uuids"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.uuids_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs index d9867246790..c5ced6819f6 100644 --- a/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs +++ b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs @@ -14,6 +14,10 @@ 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 type BluetoothDataFilterInit; + #[wasm_bindgen(method, setter = "dataPrefix")] + fn data_prefix_shim(this: &BluetoothDataFilterInit, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "mask")] + fn mask_shim(this: &BluetoothDataFilterInit, val: &::js_sys::Object); } #[cfg(web_sys_unstable_apis)] impl BluetoothDataFilterInit { @@ -36,17 +40,7 @@ impl BluetoothDataFilterInit { #[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 data_prefix(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataPrefix"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_prefix_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +51,7 @@ impl BluetoothDataFilterInit { #[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 mask(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mask_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs index 7c75bbcdc8a..e70ea5d2c1c 100644 --- a/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs +++ b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs @@ -14,6 +14,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 type BluetoothLeScanFilterInit; + #[wasm_bindgen(method, setter = "manufacturerData")] + fn manufacturer_data_shim(this: &BluetoothLeScanFilterInit, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &BluetoothLeScanFilterInit, val: &str); + #[wasm_bindgen(method, setter = "namePrefix")] + fn name_prefix_shim(this: &BluetoothLeScanFilterInit, val: &str); + #[wasm_bindgen(method, setter = "serviceData")] + fn service_data_shim(this: &BluetoothLeScanFilterInit, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "services")] + fn services_shim(this: &BluetoothLeScanFilterInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl BluetoothLeScanFilterInit { @@ -36,17 +46,7 @@ impl BluetoothLeScanFilterInit { #[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 manufacturer_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("manufacturerData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.manufacturer_data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +57,7 @@ impl BluetoothLeScanFilterInit { #[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 name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +68,7 @@ impl BluetoothLeScanFilterInit { #[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 name_prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namePrefix"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_prefix_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,17 +79,7 @@ impl BluetoothLeScanFilterInit { #[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 service_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serviceData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.service_data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -116,17 +90,7 @@ impl BluetoothLeScanFilterInit { #[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 services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("services"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.services_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs index 9ac1d174c72..3159b4567b3 100644 --- a/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs @@ -14,6 +14,17 @@ 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 type BluetoothPermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &BluetoothPermissionDescriptor, val: PermissionName); + #[wasm_bindgen(method, setter = "acceptAllDevices")] + fn accept_all_devices_shim(this: &BluetoothPermissionDescriptor, val: bool); + #[wasm_bindgen(method, setter = "deviceId")] + fn device_id_shim(this: &BluetoothPermissionDescriptor, val: &str); + #[wasm_bindgen(method, setter = "filters")] + fn filters_shim(this: &BluetoothPermissionDescriptor, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "optionalServices")] + fn optional_services_shim(this: &BluetoothPermissionDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl BluetoothPermissionDescriptor { @@ -39,13 +50,7 @@ impl BluetoothPermissionDescriptor { #[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 name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,17 +61,7 @@ impl BluetoothPermissionDescriptor { #[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 accept_all_devices(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceptAllDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.accept_all_devices_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +72,7 @@ impl BluetoothPermissionDescriptor { #[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 device_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -98,17 +83,7 @@ impl BluetoothPermissionDescriptor { #[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 filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filters_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -119,17 +94,7 @@ impl BluetoothPermissionDescriptor { #[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 optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalServices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.optional_services_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs index 57190d3a914..0ef0d117cde 100644 --- a/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs +++ b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs @@ -14,6 +14,8 @@ 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 type BluetoothPermissionStorage; + #[wasm_bindgen(method, setter = "allowedDevices")] + fn allowed_devices_shim(this: &BluetoothPermissionStorage, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl BluetoothPermissionStorage { @@ -37,17 +39,7 @@ impl BluetoothPermissionStorage { #[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 allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowedDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.allowed_devices_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BoxQuadOptions.rs b/crates/web-sys/src/features/gen_BoxQuadOptions.rs index 3b54ddb7b4e..6000d877f7c 100644 --- a/crates/web-sys/src/features/gen_BoxQuadOptions.rs +++ b/crates/web-sys/src/features/gen_BoxQuadOptions.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"] pub type BoxQuadOptions; + #[cfg(feature = "CssBoxType")] + #[wasm_bindgen(method, setter = "box")] + fn box__shim(this: &BoxQuadOptions, val: CssBoxType); + #[wasm_bindgen(method, setter = "relativeTo")] + fn relative_to_shim(this: &BoxQuadOptions, val: &::js_sys::Object); } impl BoxQuadOptions { #[doc = "Construct a new `BoxQuadOptions`."] @@ -25,30 +30,14 @@ impl BoxQuadOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`, `CssBoxType`*"] pub fn box_(&mut self, val: CssBoxType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("box"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.box__shim(val); self } #[doc = "Change the `relativeTo` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"] pub fn relative_to(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relativeTo"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.relative_to_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs b/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs index 6f91e51e4e4..2b5f6f187b8 100644 --- a/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs +++ b/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] pub type BrowserElementDownloadOptions; + #[wasm_bindgen(method, setter = "filename")] + fn filename_shim(this: &BrowserElementDownloadOptions, val: Option<&str>); + #[wasm_bindgen(method, setter = "referrer")] + fn referrer_shim(this: &BrowserElementDownloadOptions, val: Option<&str>); } impl BrowserElementDownloadOptions { #[doc = "Construct a new `BrowserElementDownloadOptions`."] @@ -24,34 +28,14 @@ impl BrowserElementDownloadOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] pub fn filename(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filename_shim(val); self } #[doc = "Change the `referrer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] pub fn referrer(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.referrer_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs b/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs index 065a954ccab..8a63b96bae3 100644 --- a/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs +++ b/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] pub type BrowserElementExecuteScriptOptions; + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &BrowserElementExecuteScriptOptions, val: Option<&str>); + #[wasm_bindgen(method, setter = "url")] + fn url_shim(this: &BrowserElementExecuteScriptOptions, val: Option<&str>); } impl BrowserElementExecuteScriptOptions { #[doc = "Construct a new `BrowserElementExecuteScriptOptions`."] @@ -24,27 +28,14 @@ impl BrowserElementExecuteScriptOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] pub fn origin(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[doc = "Change the `url` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] pub fn url(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.url_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CacheBatchOperation.rs b/crates/web-sys/src/features/gen_CacheBatchOperation.rs index 8f5a31d021e..706019c1794 100644 --- a/crates/web-sys/src/features/gen_CacheBatchOperation.rs +++ b/crates/web-sys/src/features/gen_CacheBatchOperation.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"] pub type CacheBatchOperation; + #[cfg(feature = "CacheQueryOptions")] + #[wasm_bindgen(method, setter = "options")] + fn options_shim(this: &CacheBatchOperation, val: &CacheQueryOptions); + #[cfg(feature = "Request")] + #[wasm_bindgen(method, setter = "request")] + fn request_shim(this: &CacheBatchOperation, val: &Request); + #[cfg(feature = "Response")] + #[wasm_bindgen(method, setter = "response")] + fn response_shim(this: &CacheBatchOperation, val: &Response); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &CacheBatchOperation, val: &str); } impl CacheBatchOperation { #[doc = "Construct a new `CacheBatchOperation`."] @@ -25,17 +36,7 @@ impl CacheBatchOperation { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `CacheQueryOptions`*"] pub fn options(&mut self, val: &CacheQueryOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("options"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.options_shim(val); self } #[cfg(feature = "Request")] @@ -43,17 +44,7 @@ impl CacheBatchOperation { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Request`*"] pub fn request(&mut self, val: &Request) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("request"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.request_shim(val); self } #[cfg(feature = "Response")] @@ -61,30 +52,14 @@ impl CacheBatchOperation { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Response`*"] pub fn response(&mut self, val: &Response) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("response"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.response_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CacheQueryOptions.rs b/crates/web-sys/src/features/gen_CacheQueryOptions.rs index 527080eb2ad..f7b0bdf77e8 100644 --- a/crates/web-sys/src/features/gen_CacheQueryOptions.rs +++ b/crates/web-sys/src/features/gen_CacheQueryOptions.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] pub type CacheQueryOptions; + #[wasm_bindgen(method, setter = "cacheName")] + fn cache_name_shim(this: &CacheQueryOptions, val: &str); + #[wasm_bindgen(method, setter = "ignoreMethod")] + fn ignore_method_shim(this: &CacheQueryOptions, val: bool); + #[wasm_bindgen(method, setter = "ignoreSearch")] + fn ignore_search_shim(this: &CacheQueryOptions, val: bool); + #[wasm_bindgen(method, setter = "ignoreVary")] + fn ignore_vary_shim(this: &CacheQueryOptions, val: bool); } impl CacheQueryOptions { #[doc = "Construct a new `CacheQueryOptions`."] @@ -24,68 +32,28 @@ impl CacheQueryOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] pub fn cache_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cacheName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cache_name_shim(val); self } #[doc = "Change the `ignoreMethod` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] pub fn ignore_method(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreMethod"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ignore_method_shim(val); self } #[doc = "Change the `ignoreSearch` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] pub fn ignore_search(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreSearch"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ignore_search_shim(val); self } #[doc = "Change the `ignoreVary` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] pub fn ignore_vary(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreVary"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ignore_vary_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs b/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs index cea0ebcd8cb..1a7a53e1ea7 100644 --- a/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs +++ b/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs @@ -10,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub type CaretStateChangedEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &CaretStateChangedEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &CaretStateChangedEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &CaretStateChangedEventInit, val: bool); + #[cfg(feature = "DomRectReadOnly")] + #[wasm_bindgen(method, setter = "boundingClientRect")] + fn bounding_client_rect_shim(this: &CaretStateChangedEventInit, val: Option<&DomRectReadOnly>); + #[wasm_bindgen(method, setter = "caretVisible")] + fn caret_visible_shim(this: &CaretStateChangedEventInit, val: bool); + #[wasm_bindgen(method, setter = "caretVisuallyVisible")] + fn caret_visually_visible_shim(this: &CaretStateChangedEventInit, val: bool); + #[wasm_bindgen(method, setter = "collapsed")] + fn collapsed_shim(this: &CaretStateChangedEventInit, val: bool); + #[cfg(feature = "CaretChangedReason")] + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &CaretStateChangedEventInit, val: CaretChangedReason); + #[wasm_bindgen(method, setter = "selectedTextContent")] + fn selected_text_content_shim(this: &CaretStateChangedEventInit, val: &str); + #[wasm_bindgen(method, setter = "selectionEditable")] + fn selection_editable_shim(this: &CaretStateChangedEventInit, val: bool); + #[wasm_bindgen(method, setter = "selectionVisible")] + fn selection_visible_shim(this: &CaretStateChangedEventInit, val: bool); } impl CaretStateChangedEventInit { #[doc = "Construct a new `CaretStateChangedEventInit`."] @@ -24,51 +48,21 @@ impl CaretStateChangedEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "DomRectReadOnly")] @@ -76,68 +70,28 @@ impl CaretStateChangedEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`, `DomRectReadOnly`*"] pub fn bounding_client_rect(&mut self, val: Option<&DomRectReadOnly>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("boundingClientRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bounding_client_rect_shim(val); self } #[doc = "Change the `caretVisible` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn caret_visible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("caretVisible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.caret_visible_shim(val); self } #[doc = "Change the `caretVisuallyVisible` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn caret_visually_visible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("caretVisuallyVisible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.caret_visually_visible_shim(val); self } #[doc = "Change the `collapsed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn collapsed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("collapsed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.collapsed_shim(val); self } #[cfg(feature = "CaretChangedReason")] @@ -145,65 +99,28 @@ impl CaretStateChangedEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretChangedReason`, `CaretStateChangedEventInit`*"] pub fn reason(&mut self, val: CaretChangedReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } #[doc = "Change the `selectedTextContent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn selected_text_content(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selectedTextContent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.selected_text_content_shim(val); self } #[doc = "Change the `selectionEditable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn selection_editable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selectionEditable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.selection_editable_shim(val); self } #[doc = "Change the `selectionVisible` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub fn selection_visible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selectionVisible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.selection_visible_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ChannelMergerOptions.rs b/crates/web-sys/src/features/gen_ChannelMergerOptions.rs index 314a2c24cf6..2a0566f3bcc 100644 --- a/crates/web-sys/src/features/gen_ChannelMergerOptions.rs +++ b/crates/web-sys/src/features/gen_ChannelMergerOptions.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] pub type ChannelMergerOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &ChannelMergerOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &ChannelMergerOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &ChannelMergerOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "numberOfInputs")] + fn number_of_inputs_shim(this: &ChannelMergerOptions, val: u32); } impl ChannelMergerOptions { #[doc = "Construct a new `ChannelMergerOptions`."] @@ -24,17 +34,7 @@ impl ChannelMergerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +42,7 @@ impl ChannelMergerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelMergerOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,34 +50,14 @@ impl ChannelMergerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelMergerOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `numberOfInputs` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] pub fn number_of_inputs(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfInputs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_inputs_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs b/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs index 2dc888453b5..a70a522b224 100644 --- a/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs +++ b/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] pub type ChannelSplitterOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &ChannelSplitterOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &ChannelSplitterOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &ChannelSplitterOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "numberOfOutputs")] + fn number_of_outputs_shim(this: &ChannelSplitterOptions, val: u32); } impl ChannelSplitterOptions { #[doc = "Construct a new `ChannelSplitterOptions`."] @@ -24,17 +34,7 @@ impl ChannelSplitterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +42,7 @@ impl ChannelSplitterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelSplitterOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,34 +50,14 @@ impl ChannelSplitterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelSplitterOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `numberOfOutputs` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] pub fn number_of_outputs(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfOutputs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_outputs_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CheckerboardReport.rs b/crates/web-sys/src/features/gen_CheckerboardReport.rs index 0e2f5c34112..636544b6152 100644 --- a/crates/web-sys/src/features/gen_CheckerboardReport.rs +++ b/crates/web-sys/src/features/gen_CheckerboardReport.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] pub type CheckerboardReport; + #[wasm_bindgen(method, setter = "log")] + fn log_shim(this: &CheckerboardReport, val: &str); + #[cfg(feature = "CheckerboardReason")] + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &CheckerboardReport, val: CheckerboardReason); + #[wasm_bindgen(method, setter = "severity")] + fn severity_shim(this: &CheckerboardReport, val: u32); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &CheckerboardReport, val: f64); } impl CheckerboardReport { #[doc = "Construct a new `CheckerboardReport`."] @@ -24,13 +33,7 @@ impl CheckerboardReport { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] pub fn log(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("log"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.log_shim(val); self } #[cfg(feature = "CheckerboardReason")] @@ -38,48 +41,21 @@ impl CheckerboardReport { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CheckerboardReason`, `CheckerboardReport`*"] pub fn reason(&mut self, val: CheckerboardReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } #[doc = "Change the `severity` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] pub fn severity(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("severity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.severity_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs b/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs index 234090cfd2c..b7ec7502649 100644 --- a/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs +++ b/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] pub type ChromeFilePropertyBag; + #[wasm_bindgen(method, setter = "lastModified")] + fn last_modified_shim(this: &ChromeFilePropertyBag, val: f64); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &ChromeFilePropertyBag, val: &str); + #[wasm_bindgen(method, setter = "existenceCheck")] + fn existence_check_shim(this: &ChromeFilePropertyBag, val: bool); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &ChromeFilePropertyBag, val: &str); } impl ChromeFilePropertyBag { #[doc = "Construct a new `ChromeFilePropertyBag`."] @@ -24,60 +32,28 @@ impl ChromeFilePropertyBag { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] pub fn last_modified(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastModified"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_modified_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } #[doc = "Change the `existenceCheck` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] pub fn existence_check(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("existenceCheck"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.existence_check_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ClientQueryOptions.rs b/crates/web-sys/src/features/gen_ClientQueryOptions.rs index fdbb30dc459..79f6f0913c6 100644 --- a/crates/web-sys/src/features/gen_ClientQueryOptions.rs +++ b/crates/web-sys/src/features/gen_ClientQueryOptions.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`*"] pub type ClientQueryOptions; + #[wasm_bindgen(method, setter = "includeUncontrolled")] + fn include_uncontrolled_shim(this: &ClientQueryOptions, val: bool); + #[cfg(feature = "ClientType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &ClientQueryOptions, val: ClientType); } impl ClientQueryOptions { #[doc = "Construct a new `ClientQueryOptions`."] @@ -24,17 +29,7 @@ impl ClientQueryOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`*"] pub fn include_uncontrolled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("includeUncontrolled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.include_uncontrolled_shim(val); self } #[cfg(feature = "ClientType")] @@ -42,13 +37,7 @@ impl ClientQueryOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`, `ClientType`*"] pub fn type_(&mut self, val: ClientType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs b/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs index a063f0a56d4..151fd20d628 100644 --- a/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs +++ b/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"] pub type ClientRectsAndTexts; + #[cfg(feature = "DomRectList")] + #[wasm_bindgen(method, setter = "rectList")] + fn rect_list_shim(this: &ClientRectsAndTexts, val: &DomRectList); + #[wasm_bindgen(method, setter = "textList")] + fn text_list_shim(this: &ClientRectsAndTexts, val: &::wasm_bindgen::JsValue); } impl ClientRectsAndTexts { #[cfg(feature = "DomRectList")] @@ -28,34 +33,14 @@ impl ClientRectsAndTexts { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`, `DomRectList`*"] pub fn rect_list(&mut self, val: &DomRectList) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rectList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rect_list_shim(val); self } #[doc = "Change the `textList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"] pub fn text_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("textList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.text_list_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ClipboardEventInit.rs b/crates/web-sys/src/features/gen_ClipboardEventInit.rs index 6f0cb3acfef..57fae5e2914 100644 --- a/crates/web-sys/src/features/gen_ClipboardEventInit.rs +++ b/crates/web-sys/src/features/gen_ClipboardEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] pub type ClipboardEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ClipboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ClipboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ClipboardEventInit, val: bool); + #[cfg(feature = "DataTransfer")] + #[wasm_bindgen(method, setter = "clipboardData")] + fn clipboard_data_shim(this: &ClipboardEventInit, val: Option<&DataTransfer>); } impl ClipboardEventInit { #[doc = "Construct a new `ClipboardEventInit`."] @@ -24,51 +33,21 @@ impl ClipboardEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "DataTransfer")] @@ -76,17 +55,7 @@ impl ClipboardEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`, `DataTransfer`*"] pub fn clipboard_data(&mut self, val: Option<&DataTransfer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clipboardData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clipboard_data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ClipboardItemOptions.rs b/crates/web-sys/src/features/gen_ClipboardItemOptions.rs index c83e7ae1e62..5930f6d857a 100644 --- a/crates/web-sys/src/features/gen_ClipboardItemOptions.rs +++ b/crates/web-sys/src/features/gen_ClipboardItemOptions.rs @@ -14,6 +14,9 @@ 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 type ClipboardItemOptions; + #[cfg(feature = "PresentationStyle")] + #[wasm_bindgen(method, setter = "presentationStyle")] + fn presentation_style_shim(this: &ClipboardItemOptions, val: PresentationStyle); } #[cfg(web_sys_unstable_apis)] impl ClipboardItemOptions { @@ -37,17 +40,7 @@ impl ClipboardItemOptions { #[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 presentation_style(&mut self, val: PresentationStyle) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("presentationStyle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.presentation_style_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs b/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs index 8028a269f1d..5c8ac6e004d 100644 --- a/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs @@ -14,6 +14,11 @@ 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 type ClipboardPermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &ClipboardPermissionDescriptor, val: PermissionName); + #[wasm_bindgen(method, setter = "allowWithoutGesture")] + fn allow_without_gesture_shim(this: &ClipboardPermissionDescriptor, val: bool); } #[cfg(web_sys_unstable_apis)] impl ClipboardPermissionDescriptor { @@ -39,13 +44,7 @@ impl ClipboardPermissionDescriptor { #[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 name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,17 +55,7 @@ impl ClipboardPermissionDescriptor { #[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 allow_without_gesture(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowWithoutGesture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.allow_without_gesture_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CloseEventInit.rs b/crates/web-sys/src/features/gen_CloseEventInit.rs index f32e46ac065..16b73d6cd89 100644 --- a/crates/web-sys/src/features/gen_CloseEventInit.rs +++ b/crates/web-sys/src/features/gen_CloseEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub type CloseEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &CloseEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &CloseEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &CloseEventInit, val: bool); + #[wasm_bindgen(method, setter = "code")] + fn code_shim(this: &CloseEventInit, val: u16); + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &CloseEventInit, val: &str); + #[wasm_bindgen(method, setter = "wasClean")] + fn was_clean_shim(this: &CloseEventInit, val: bool); } impl CloseEventInit { #[doc = "Construct a new `CloseEventInit`."] @@ -24,95 +36,42 @@ impl CloseEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `code` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub fn code(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.code_shim(val); self } #[doc = "Change the `reason` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub fn reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } #[doc = "Change the `wasClean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub fn was_clean(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wasClean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.was_clean_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CollectedClientData.rs b/crates/web-sys/src/features/gen_CollectedClientData.rs index 19985910d9c..96b9b4a5d0e 100644 --- a/crates/web-sys/src/features/gen_CollectedClientData.rs +++ b/crates/web-sys/src/features/gen_CollectedClientData.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub type CollectedClientData; + #[wasm_bindgen(method, setter = "challenge")] + fn challenge_shim(this: &CollectedClientData, val: &str); + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[wasm_bindgen(method, setter = "clientExtensions")] + fn client_extensions_shim( + this: &CollectedClientData, + val: &AuthenticationExtensionsClientInputs, + ); + #[wasm_bindgen(method, setter = "hashAlgorithm")] + fn hash_algorithm_shim(this: &CollectedClientData, val: &str); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &CollectedClientData, val: &str); + #[wasm_bindgen(method, setter = "tokenBindingId")] + fn token_binding_id_shim(this: &CollectedClientData, val: &str); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &CollectedClientData, val: &str); } impl CollectedClientData { #[doc = "Construct a new `CollectedClientData`."] @@ -28,17 +44,7 @@ impl CollectedClientData { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub fn challenge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.challenge_shim(val); self } #[cfg(feature = "AuthenticationExtensionsClientInputs")] @@ -46,78 +52,35 @@ impl CollectedClientData { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `CollectedClientData`*"] pub fn client_extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientExtensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_extensions_shim(val); self } #[doc = "Change the `hashAlgorithm` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub fn hash_algorithm(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hashAlgorithm"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_algorithm_shim(val); self } #[doc = "Change the `origin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[doc = "Change the `tokenBindingId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub fn token_binding_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tokenBindingId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.token_binding_id_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CompositionEventInit.rs b/crates/web-sys/src/features/gen_CompositionEventInit.rs index d912089b042..8f2ec5a6b48 100644 --- a/crates/web-sys/src/features/gen_CompositionEventInit.rs +++ b/crates/web-sys/src/features/gen_CompositionEventInit.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub type CompositionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &CompositionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &CompositionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &CompositionEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &CompositionEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &CompositionEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &CompositionEventInit, val: &str); } impl CompositionEventInit { #[doc = "Construct a new `CompositionEventInit`."] @@ -24,65 +37,28 @@ impl CompositionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,26 +66,14 @@ impl CompositionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub fn data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ComputedEffectTiming.rs b/crates/web-sys/src/features/gen_ComputedEffectTiming.rs index 85ab85a0060..8d55c2533ea 100644 --- a/crates/web-sys/src/features/gen_ComputedEffectTiming.rs +++ b/crates/web-sys/src/features/gen_ComputedEffectTiming.rs @@ -10,6 +10,34 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub type ComputedEffectTiming; + #[wasm_bindgen(method, setter = "delay")] + fn delay_shim(this: &ComputedEffectTiming, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &ComputedEffectTiming, val: PlaybackDirection); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &ComputedEffectTiming, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &ComputedEffectTiming, val: &str); + #[wasm_bindgen(method, setter = "endDelay")] + fn end_delay_shim(this: &ComputedEffectTiming, val: f64); + #[cfg(feature = "FillMode")] + #[wasm_bindgen(method, setter = "fill")] + fn fill_shim(this: &ComputedEffectTiming, val: FillMode); + #[wasm_bindgen(method, setter = "iterationStart")] + fn iteration_start_shim(this: &ComputedEffectTiming, val: f64); + #[wasm_bindgen(method, setter = "iterations")] + fn iterations_shim(this: &ComputedEffectTiming, val: f64); + #[wasm_bindgen(method, setter = "activeDuration")] + fn active_duration_shim(this: &ComputedEffectTiming, val: f64); + #[wasm_bindgen(method, setter = "currentIteration")] + fn current_iteration_shim(this: &ComputedEffectTiming, val: Option); + #[wasm_bindgen(method, setter = "endTime")] + fn end_time_shim(this: &ComputedEffectTiming, val: f64); + #[wasm_bindgen(method, setter = "localTime")] + fn local_time_shim(this: &ComputedEffectTiming, val: Option); + #[wasm_bindgen(method, setter = "progress")] + fn progress_shim(this: &ComputedEffectTiming, val: Option); } impl ComputedEffectTiming { #[doc = "Construct a new `ComputedEffectTiming`."] @@ -24,13 +52,7 @@ impl ComputedEffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_shim(val); self } #[cfg(feature = "PlaybackDirection")] @@ -38,65 +60,28 @@ impl ComputedEffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `PlaybackDirection`*"] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[doc = "Change the `duration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `endDelay` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_delay_shim(val); self } #[cfg(feature = "FillMode")] @@ -104,132 +89,56 @@ impl ComputedEffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `FillMode`*"] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fill_shim(val); self } #[doc = "Change the `iterationStart` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_start_shim(val); self } #[doc = "Change the `iterations` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iterations_shim(val); self } #[doc = "Change the `activeDuration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn active_duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("activeDuration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.active_duration_shim(val); self } #[doc = "Change the `currentIteration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn current_iteration(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("currentIteration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.current_iteration_shim(val); self } #[doc = "Change the `endTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn end_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_time_shim(val); self } #[doc = "Change the `localTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn local_time(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.local_time_shim(val); self } #[doc = "Change the `progress` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub fn progress(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("progress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.progress_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConnStatusDict.rs b/crates/web-sys/src/features/gen_ConnStatusDict.rs index 0a488ebb8ea..be5540fc998 100644 --- a/crates/web-sys/src/features/gen_ConnStatusDict.rs +++ b/crates/web-sys/src/features/gen_ConnStatusDict.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"] pub type ConnStatusDict; + #[wasm_bindgen(method, setter = "status")] + fn status_shim(this: &ConnStatusDict, val: &str); } impl ConnStatusDict { #[doc = "Construct a new `ConnStatusDict`."] @@ -24,14 +26,7 @@ impl ConnStatusDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"] pub fn status(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.status_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleCounter.rs b/crates/web-sys/src/features/gen_ConsoleCounter.rs index e3a80a95ea9..be0416a4baf 100644 --- a/crates/web-sys/src/features/gen_ConsoleCounter.rs +++ b/crates/web-sys/src/features/gen_ConsoleCounter.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] pub type ConsoleCounter; + #[wasm_bindgen(method, setter = "count")] + fn count_shim(this: &ConsoleCounter, val: u32); + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &ConsoleCounter, val: &str); } impl ConsoleCounter { #[doc = "Construct a new `ConsoleCounter`."] @@ -24,26 +28,14 @@ impl ConsoleCounter { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] pub fn count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.count_shim(val); self } #[doc = "Change the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleCounterError.rs b/crates/web-sys/src/features/gen_ConsoleCounterError.rs index 91da438f714..69738146c54 100644 --- a/crates/web-sys/src/features/gen_ConsoleCounterError.rs +++ b/crates/web-sys/src/features/gen_ConsoleCounterError.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] pub type ConsoleCounterError; + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &ConsoleCounterError, val: &str); + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &ConsoleCounterError, val: &str); } impl ConsoleCounterError { #[doc = "Construct a new `ConsoleCounterError`."] @@ -24,26 +28,14 @@ impl ConsoleCounterError { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] pub fn error(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[doc = "Change the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleEvent.rs b/crates/web-sys/src/features/gen_ConsoleEvent.rs index 3f56778fcb3..d88d063f088 100644 --- a/crates/web-sys/src/features/gen_ConsoleEvent.rs +++ b/crates/web-sys/src/features/gen_ConsoleEvent.rs @@ -10,6 +10,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub type ConsoleEvent; + #[wasm_bindgen(method, setter = "ID")] + fn id_shim(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "addonId")] + fn addon_id_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "arguments")] + fn arguments_shim(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "columnNumber")] + fn column_number_shim(this: &ConsoleEvent, val: u32); + #[wasm_bindgen(method, setter = "consoleID")] + fn console_id_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "counter")] + fn counter_shim(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "filename")] + fn filename_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "functionName")] + fn function_name_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "groupName")] + fn group_name_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "innerID")] + fn inner_id_shim(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "level")] + fn level_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "lineNumber")] + fn line_number_shim(this: &ConsoleEvent, val: u32); + #[wasm_bindgen(method, setter = "prefix")] + fn prefix_shim(this: &ConsoleEvent, val: &str); + #[wasm_bindgen(method, setter = "private")] + fn private_shim(this: &ConsoleEvent, val: bool); + #[wasm_bindgen(method, setter = "styles")] + fn styles_shim(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "timeStamp")] + fn time_stamp_shim(this: &ConsoleEvent, val: f64); + #[wasm_bindgen(method, setter = "timer")] + fn timer_shim(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); } impl ConsoleEvent { #[doc = "Construct a new `ConsoleEvent`."] @@ -24,271 +58,119 @@ impl ConsoleEvent { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ID"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `addonId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn addon_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addonId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.addon_id_shim(val); self } #[doc = "Change the `arguments` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn arguments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arguments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.arguments_shim(val); self } #[doc = "Change the `columnNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn column_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("columnNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.column_number_shim(val); self } #[doc = "Change the `consoleID` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn console_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("consoleID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.console_id_shim(val); self } #[doc = "Change the `counter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn counter(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("counter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.counter_shim(val); self } #[doc = "Change the `filename` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn filename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filename_shim(val); self } #[doc = "Change the `functionName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn function_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("functionName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.function_name_shim(val); self } #[doc = "Change the `groupName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn group_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("groupName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.group_name_shim(val); self } #[doc = "Change the `innerID` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn inner_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("innerID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.inner_id_shim(val); self } #[doc = "Change the `level` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn level(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("level"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.level_shim(val); self } #[doc = "Change the `lineNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn line_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lineNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.line_number_shim(val); self } #[doc = "Change the `prefix` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prefix_shim(val); self } #[doc = "Change the `private` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn private(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("private"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.private_shim(val); self } #[doc = "Change the `styles` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn styles(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("styles"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.styles_shim(val); self } #[doc = "Change the `timeStamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn time_stamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeStamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.time_stamp_shim(val); self } #[doc = "Change the `timer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub fn timer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("timer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timer_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs b/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs index 80bdfc54dfd..2b807509ef7 100644 --- a/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs +++ b/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub type ConsoleInstanceOptions; + #[wasm_bindgen(method, setter = "consoleID")] + fn console_id_shim(this: &ConsoleInstanceOptions, val: &str); + #[wasm_bindgen(method, setter = "dump")] + fn dump_shim(this: &ConsoleInstanceOptions, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "innerID")] + fn inner_id_shim(this: &ConsoleInstanceOptions, val: &str); + #[cfg(feature = "ConsoleLogLevel")] + #[wasm_bindgen(method, setter = "maxLogLevel")] + fn max_log_level_shim(this: &ConsoleInstanceOptions, val: ConsoleLogLevel); + #[wasm_bindgen(method, setter = "maxLogLevelPref")] + fn max_log_level_pref_shim(this: &ConsoleInstanceOptions, val: &str); + #[wasm_bindgen(method, setter = "prefix")] + fn prefix_shim(this: &ConsoleInstanceOptions, val: &str); } impl ConsoleInstanceOptions { #[doc = "Construct a new `ConsoleInstanceOptions`."] @@ -24,47 +37,21 @@ impl ConsoleInstanceOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub fn console_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("consoleID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.console_id_shim(val); self } #[doc = "Change the `dump` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub fn dump(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dump"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dump_shim(val); self } #[doc = "Change the `innerID` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub fn inner_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("innerID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.inner_id_shim(val); self } #[cfg(feature = "ConsoleLogLevel")] @@ -72,48 +59,21 @@ impl ConsoleInstanceOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`, `ConsoleLogLevel`*"] pub fn max_log_level(&mut self, val: ConsoleLogLevel) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxLogLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_log_level_shim(val); self } #[doc = "Change the `maxLogLevelPref` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub fn max_log_level_pref(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxLogLevelPref"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_log_level_pref_shim(val); self } #[doc = "Change the `prefix` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub fn prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prefix_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs b/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs index 684c2de3ed9..833b5be4d40 100644 --- a/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs +++ b/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] pub type ConsoleProfileEvent; + #[wasm_bindgen(method, setter = "action")] + fn action_shim(this: &ConsoleProfileEvent, val: &str); + #[wasm_bindgen(method, setter = "arguments")] + fn arguments_shim(this: &ConsoleProfileEvent, val: &::wasm_bindgen::JsValue); } impl ConsoleProfileEvent { #[doc = "Construct a new `ConsoleProfileEvent`."] @@ -24,31 +28,14 @@ impl ConsoleProfileEvent { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] pub fn action(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("action"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.action_shim(val); self } #[doc = "Change the `arguments` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] pub fn arguments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arguments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.arguments_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleStackEntry.rs b/crates/web-sys/src/features/gen_ConsoleStackEntry.rs index 65fef9ecff4..12555018b78 100644 --- a/crates/web-sys/src/features/gen_ConsoleStackEntry.rs +++ b/crates/web-sys/src/features/gen_ConsoleStackEntry.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub type ConsoleStackEntry; + #[wasm_bindgen(method, setter = "asyncCause")] + fn async_cause_shim(this: &ConsoleStackEntry, val: Option<&str>); + #[wasm_bindgen(method, setter = "columnNumber")] + fn column_number_shim(this: &ConsoleStackEntry, val: u32); + #[wasm_bindgen(method, setter = "filename")] + fn filename_shim(this: &ConsoleStackEntry, val: &str); + #[wasm_bindgen(method, setter = "functionName")] + fn function_name_shim(this: &ConsoleStackEntry, val: &str); + #[wasm_bindgen(method, setter = "lineNumber")] + fn line_number_shim(this: &ConsoleStackEntry, val: u32); } impl ConsoleStackEntry { #[doc = "Construct a new `ConsoleStackEntry`."] @@ -24,85 +34,35 @@ impl ConsoleStackEntry { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub fn async_cause(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("asyncCause"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.async_cause_shim(val); self } #[doc = "Change the `columnNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub fn column_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("columnNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.column_number_shim(val); self } #[doc = "Change the `filename` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub fn filename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filename_shim(val); self } #[doc = "Change the `functionName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub fn function_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("functionName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.function_name_shim(val); self } #[doc = "Change the `lineNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub fn line_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lineNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.line_number_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleTimerError.rs b/crates/web-sys/src/features/gen_ConsoleTimerError.rs index 2ad058bec3f..9455aff12d3 100644 --- a/crates/web-sys/src/features/gen_ConsoleTimerError.rs +++ b/crates/web-sys/src/features/gen_ConsoleTimerError.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] pub type ConsoleTimerError; + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &ConsoleTimerError, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &ConsoleTimerError, val: &str); } impl ConsoleTimerError { #[doc = "Construct a new `ConsoleTimerError`."] @@ -24,26 +28,14 @@ impl ConsoleTimerError { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] pub fn error(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs b/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs index 471a92f7caa..0d3b294a926 100644 --- a/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs +++ b/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] pub type ConsoleTimerLogOrEnd; + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &ConsoleTimerLogOrEnd, val: f64); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &ConsoleTimerLogOrEnd, val: &str); } impl ConsoleTimerLogOrEnd { #[doc = "Construct a new `ConsoleTimerLogOrEnd`."] @@ -24,30 +28,14 @@ impl ConsoleTimerLogOrEnd { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleTimerStart.rs b/crates/web-sys/src/features/gen_ConsoleTimerStart.rs index f418961908d..d4e2a17d04c 100644 --- a/crates/web-sys/src/features/gen_ConsoleTimerStart.rs +++ b/crates/web-sys/src/features/gen_ConsoleTimerStart.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerStart`*"] pub type ConsoleTimerStart; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &ConsoleTimerStart, val: &str); } impl ConsoleTimerStart { #[doc = "Construct a new `ConsoleTimerStart`."] @@ -24,13 +26,7 @@ impl ConsoleTimerStart { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerStart`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstantSourceOptions.rs b/crates/web-sys/src/features/gen_ConstantSourceOptions.rs index 852e2dad925..206ed0a76af 100644 --- a/crates/web-sys/src/features/gen_ConstantSourceOptions.rs +++ b/crates/web-sys/src/features/gen_ConstantSourceOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstantSourceOptions`*"] pub type ConstantSourceOptions; + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &ConstantSourceOptions, val: f32); } impl ConstantSourceOptions { #[doc = "Construct a new `ConstantSourceOptions`."] @@ -24,14 +26,7 @@ impl ConstantSourceOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstantSourceOptions`*"] pub fn offset(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs b/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs index 8bffa143882..6885925daa3 100644 --- a/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs +++ b/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] pub type ConstrainBooleanParameters; + #[wasm_bindgen(method, setter = "exact")] + fn exact_shim(this: &ConstrainBooleanParameters, val: bool); + #[wasm_bindgen(method, setter = "ideal")] + fn ideal_shim(this: &ConstrainBooleanParameters, val: bool); } impl ConstrainBooleanParameters { #[doc = "Construct a new `ConstrainBooleanParameters`."] @@ -24,26 +28,14 @@ impl ConstrainBooleanParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] pub fn exact(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exact_shim(val); self } #[doc = "Change the `ideal` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] pub fn ideal(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ideal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs b/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs index e43df4782e9..71f3bf16b92 100644 --- a/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs +++ b/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] pub type ConstrainDomStringParameters; + #[wasm_bindgen(method, setter = "exact")] + fn exact_shim(this: &ConstrainDomStringParameters, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "ideal")] + fn ideal_shim(this: &ConstrainDomStringParameters, val: &::wasm_bindgen::JsValue); } impl ConstrainDomStringParameters { #[doc = "Construct a new `ConstrainDomStringParameters`."] @@ -24,26 +28,14 @@ impl ConstrainDomStringParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] pub fn exact(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exact_shim(val); self } #[doc = "Change the `ideal` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] pub fn ideal(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ideal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs b/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs index 777a98149ce..ac4e0ccb31f 100644 --- a/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs +++ b/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] pub type ConstrainDoubleRange; + #[wasm_bindgen(method, setter = "exact")] + fn exact_shim(this: &ConstrainDoubleRange, val: f64); + #[wasm_bindgen(method, setter = "ideal")] + fn ideal_shim(this: &ConstrainDoubleRange, val: f64); + #[wasm_bindgen(method, setter = "max")] + fn max_shim(this: &ConstrainDoubleRange, val: f64); + #[wasm_bindgen(method, setter = "min")] + fn min_shim(this: &ConstrainDoubleRange, val: f64); } impl ConstrainDoubleRange { #[doc = "Construct a new `ConstrainDoubleRange`."] @@ -24,52 +32,28 @@ impl ConstrainDoubleRange { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] pub fn exact(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exact_shim(val); self } #[doc = "Change the `ideal` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] pub fn ideal(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ideal_shim(val); self } #[doc = "Change the `max` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] pub fn max(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("max"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_shim(val); self } #[doc = "Change the `min` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] pub fn min(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("min"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainLongRange.rs b/crates/web-sys/src/features/gen_ConstrainLongRange.rs index c3a79853cd4..58deaf0f387 100644 --- a/crates/web-sys/src/features/gen_ConstrainLongRange.rs +++ b/crates/web-sys/src/features/gen_ConstrainLongRange.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] pub type ConstrainLongRange; + #[wasm_bindgen(method, setter = "exact")] + fn exact_shim(this: &ConstrainLongRange, val: i32); + #[wasm_bindgen(method, setter = "ideal")] + fn ideal_shim(this: &ConstrainLongRange, val: i32); + #[wasm_bindgen(method, setter = "max")] + fn max_shim(this: &ConstrainLongRange, val: i32); + #[wasm_bindgen(method, setter = "min")] + fn min_shim(this: &ConstrainLongRange, val: i32); } impl ConstrainLongRange { #[doc = "Construct a new `ConstrainLongRange`."] @@ -24,52 +32,28 @@ impl ConstrainLongRange { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] pub fn exact(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exact_shim(val); self } #[doc = "Change the `ideal` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] pub fn ideal(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ideal_shim(val); self } #[doc = "Change the `max` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] pub fn max(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("max"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_shim(val); self } #[doc = "Change the `min` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] pub fn min(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("min"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ContextAttributes2d.rs b/crates/web-sys/src/features/gen_ContextAttributes2d.rs index 9bb0cf10749..6e46206dd2a 100644 --- a/crates/web-sys/src/features/gen_ContextAttributes2d.rs +++ b/crates/web-sys/src/features/gen_ContextAttributes2d.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] pub type ContextAttributes2d; + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &ContextAttributes2d, val: bool); + #[wasm_bindgen(method, setter = "willReadFrequently")] + fn will_read_frequently_shim(this: &ContextAttributes2d, val: bool); } impl ContextAttributes2d { #[doc = "Construct a new `ContextAttributes2d`."] @@ -24,30 +28,14 @@ impl ContextAttributes2d { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] pub fn alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[doc = "Change the `willReadFrequently` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] pub fn will_read_frequently(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("willReadFrequently"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.will_read_frequently_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs b/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs index 8020dbabe7d..0e1493f0a85 100644 --- a/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs +++ b/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`*"] pub type ConvertCoordinateOptions; + #[cfg(feature = "CssBoxType")] + #[wasm_bindgen(method, setter = "fromBox")] + fn from_box_shim(this: &ConvertCoordinateOptions, val: CssBoxType); + #[cfg(feature = "CssBoxType")] + #[wasm_bindgen(method, setter = "toBox")] + fn to_box_shim(this: &ConvertCoordinateOptions, val: CssBoxType); } impl ConvertCoordinateOptions { #[doc = "Construct a new `ConvertCoordinateOptions`."] @@ -25,17 +31,7 @@ impl ConvertCoordinateOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] pub fn from_box(&mut self, val: CssBoxType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fromBox"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.from_box_shim(val); self } #[cfg(feature = "CssBoxType")] @@ -43,13 +39,7 @@ impl ConvertCoordinateOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] pub fn to_box(&mut self, val: CssBoxType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("toBox"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.to_box_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ConvolverOptions.rs b/crates/web-sys/src/features/gen_ConvolverOptions.rs index 77090404b45..db3fe68d2f5 100644 --- a/crates/web-sys/src/features/gen_ConvolverOptions.rs +++ b/crates/web-sys/src/features/gen_ConvolverOptions.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] pub type ConvolverOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &ConvolverOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &ConvolverOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &ConvolverOptions, val: ChannelInterpretation); + #[cfg(feature = "AudioBuffer")] + #[wasm_bindgen(method, setter = "buffer")] + fn buffer_shim(this: &ConvolverOptions, val: Option<&AudioBuffer>); + #[wasm_bindgen(method, setter = "disableNormalization")] + fn disable_normalization_shim(this: &ConvolverOptions, val: bool); } impl ConvolverOptions { #[doc = "Construct a new `ConvolverOptions`."] @@ -24,17 +37,7 @@ impl ConvolverOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +45,7 @@ impl ConvolverOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ConvolverOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,17 +53,7 @@ impl ConvolverOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ConvolverOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[cfg(feature = "AudioBuffer")] @@ -78,31 +61,14 @@ impl ConvolverOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `ConvolverOptions`*"] pub fn buffer(&mut self, val: Option<&AudioBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffer_shim(val); self } #[doc = "Change the `disableNormalization` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] pub fn disable_normalization(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disableNormalization"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.disable_normalization_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CredentialCreationOptions.rs b/crates/web-sys/src/features/gen_CredentialCreationOptions.rs index d57ebd3c66c..f9366322156 100644 --- a/crates/web-sys/src/features/gen_CredentialCreationOptions.rs +++ b/crates/web-sys/src/features/gen_CredentialCreationOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialCreationOptions`*"] pub type CredentialCreationOptions; + #[cfg(feature = "PublicKeyCredentialCreationOptions")] + #[wasm_bindgen(method, setter = "publicKey")] + fn public_key_shim(this: &CredentialCreationOptions, val: &PublicKeyCredentialCreationOptions); + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &CredentialCreationOptions, val: &AbortSignal); } impl CredentialCreationOptions { #[doc = "Construct a new `CredentialCreationOptions`."] @@ -25,17 +31,7 @@ impl CredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialCreationOptions`, `PublicKeyCredentialCreationOptions`*"] pub fn public_key(&mut self, val: &PublicKeyCredentialCreationOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("publicKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.public_key_shim(val); self } #[cfg(feature = "AbortSignal")] @@ -43,14 +39,7 @@ impl CredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialCreationOptions`*"] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CredentialRequestOptions.rs b/crates/web-sys/src/features/gen_CredentialRequestOptions.rs index cf44865e70a..6df51ff0ab1 100644 --- a/crates/web-sys/src/features/gen_CredentialRequestOptions.rs +++ b/crates/web-sys/src/features/gen_CredentialRequestOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialRequestOptions`*"] pub type CredentialRequestOptions; + #[cfg(feature = "PublicKeyCredentialRequestOptions")] + #[wasm_bindgen(method, setter = "publicKey")] + fn public_key_shim(this: &CredentialRequestOptions, val: &PublicKeyCredentialRequestOptions); + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &CredentialRequestOptions, val: &AbortSignal); } impl CredentialRequestOptions { #[doc = "Construct a new `CredentialRequestOptions`."] @@ -25,17 +31,7 @@ impl CredentialRequestOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialRequestOptions`, `PublicKeyCredentialRequestOptions`*"] pub fn public_key(&mut self, val: &PublicKeyCredentialRequestOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("publicKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.public_key_shim(val); self } #[cfg(feature = "AbortSignal")] @@ -43,14 +39,7 @@ impl CredentialRequestOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialRequestOptions`*"] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CryptoKeyPair.rs b/crates/web-sys/src/features/gen_CryptoKeyPair.rs index 9f04bd181fe..2edbf68355b 100644 --- a/crates/web-sys/src/features/gen_CryptoKeyPair.rs +++ b/crates/web-sys/src/features/gen_CryptoKeyPair.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKeyPair`*"] pub type CryptoKeyPair; + #[cfg(feature = "CryptoKey")] + #[wasm_bindgen(method, setter = "privateKey")] + fn private_key_shim(this: &CryptoKeyPair, val: &CryptoKey); + #[cfg(feature = "CryptoKey")] + #[wasm_bindgen(method, setter = "publicKey")] + fn public_key_shim(this: &CryptoKeyPair, val: &CryptoKey); } impl CryptoKeyPair { #[cfg(feature = "CryptoKey")] @@ -28,17 +34,7 @@ impl CryptoKeyPair { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] pub fn private_key(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("privateKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.private_key_shim(val); self } #[cfg(feature = "CryptoKey")] @@ -46,17 +42,7 @@ impl CryptoKeyPair { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] pub fn public_key(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("publicKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.public_key_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_CustomEventInit.rs b/crates/web-sys/src/features/gen_CustomEventInit.rs index ced880c09b7..aaeb6d7a4d7 100644 --- a/crates/web-sys/src/features/gen_CustomEventInit.rs +++ b/crates/web-sys/src/features/gen_CustomEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] pub type CustomEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &CustomEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &CustomEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &CustomEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &CustomEventInit, val: &::wasm_bindgen::JsValue); } impl CustomEventInit { #[doc = "Construct a new `CustomEventInit`."] @@ -24,65 +32,28 @@ impl CustomEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] pub fn detail(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DateTimeValue.rs b/crates/web-sys/src/features/gen_DateTimeValue.rs index 861d469e7ca..e156222ec16 100644 --- a/crates/web-sys/src/features/gen_DateTimeValue.rs +++ b/crates/web-sys/src/features/gen_DateTimeValue.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub type DateTimeValue; + #[wasm_bindgen(method, setter = "day")] + fn day_shim(this: &DateTimeValue, val: i32); + #[wasm_bindgen(method, setter = "hour")] + fn hour_shim(this: &DateTimeValue, val: i32); + #[wasm_bindgen(method, setter = "minute")] + fn minute_shim(this: &DateTimeValue, val: i32); + #[wasm_bindgen(method, setter = "month")] + fn month_shim(this: &DateTimeValue, val: i32); + #[wasm_bindgen(method, setter = "year")] + fn year_shim(this: &DateTimeValue, val: i32); } impl DateTimeValue { #[doc = "Construct a new `DateTimeValue`."] @@ -24,66 +34,35 @@ impl DateTimeValue { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub fn day(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("day"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.day_shim(val); self } #[doc = "Change the `hour` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub fn hour(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hour"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hour_shim(val); self } #[doc = "Change the `minute` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub fn minute(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("minute"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.minute_shim(val); self } #[doc = "Change the `month` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub fn month(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("month"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.month_shim(val); self } #[doc = "Change the `year` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub fn year(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("year"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.year_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs b/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs index c051c234892..ff00d5bc28a 100644 --- a/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs +++ b/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs @@ -10,6 +10,21 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub type DecoderDoctorNotification; + #[wasm_bindgen(method, setter = "decodeIssue")] + fn decode_issue_shim(this: &DecoderDoctorNotification, val: &str); + #[wasm_bindgen(method, setter = "decoderDoctorReportId")] + fn decoder_doctor_report_id_shim(this: &DecoderDoctorNotification, val: &str); + #[wasm_bindgen(method, setter = "docURL")] + fn doc_url_shim(this: &DecoderDoctorNotification, val: &str); + #[wasm_bindgen(method, setter = "formats")] + fn formats_shim(this: &DecoderDoctorNotification, val: &str); + #[wasm_bindgen(method, setter = "isSolved")] + fn is_solved_shim(this: &DecoderDoctorNotification, val: bool); + #[wasm_bindgen(method, setter = "resourceURL")] + fn resource_url_shim(this: &DecoderDoctorNotification, val: &str); + #[cfg(feature = "DecoderDoctorNotificationType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &DecoderDoctorNotification, val: DecoderDoctorNotificationType); } impl DecoderDoctorNotification { #[cfg(feature = "DecoderDoctorNotificationType")] @@ -32,99 +47,42 @@ impl DecoderDoctorNotification { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub fn decode_issue(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decodeIssue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.decode_issue_shim(val); self } #[doc = "Change the `decoderDoctorReportId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub fn decoder_doctor_report_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decoderDoctorReportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.decoder_doctor_report_id_shim(val); self } #[doc = "Change the `docURL` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub fn doc_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("docURL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.doc_url_shim(val); self } #[doc = "Change the `formats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub fn formats(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("formats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.formats_shim(val); self } #[doc = "Change the `isSolved` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub fn is_solved(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isSolved"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_solved_shim(val); self } #[doc = "Change the `resourceURL` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub fn resource_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resourceURL"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.resource_url_shim(val); self } #[cfg(feature = "DecoderDoctorNotificationType")] @@ -132,13 +90,7 @@ impl DecoderDoctorNotification { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`, `DecoderDoctorNotificationType`*"] pub fn type_(&mut self, val: DecoderDoctorNotificationType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DelayOptions.rs b/crates/web-sys/src/features/gen_DelayOptions.rs index a7e31dcce88..02afb9d4bf3 100644 --- a/crates/web-sys/src/features/gen_DelayOptions.rs +++ b/crates/web-sys/src/features/gen_DelayOptions.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] pub type DelayOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &DelayOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &DelayOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &DelayOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "delayTime")] + fn delay_time_shim(this: &DelayOptions, val: f64); + #[wasm_bindgen(method, setter = "maxDelayTime")] + fn max_delay_time_shim(this: &DelayOptions, val: f64); } impl DelayOptions { #[doc = "Construct a new `DelayOptions`."] @@ -24,17 +36,7 @@ impl DelayOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +44,7 @@ impl DelayOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DelayOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,51 +52,21 @@ impl DelayOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DelayOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `delayTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] pub fn delay_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("delayTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_time_shim(val); self } #[doc = "Change the `maxDelayTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] pub fn max_delay_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDelayTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_delay_time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs b/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs index b28ecb1f0c0..f94475e8d2e 100644 --- a/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs +++ b/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] pub type DeviceAccelerationInit; + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &DeviceAccelerationInit, val: Option); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &DeviceAccelerationInit, val: Option); + #[wasm_bindgen(method, setter = "z")] + fn z_shim(this: &DeviceAccelerationInit, val: Option); } impl DeviceAccelerationInit { #[doc = "Construct a new `DeviceAccelerationInit`."] @@ -24,39 +30,21 @@ impl DeviceAccelerationInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] pub fn x(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[doc = "Change the `y` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] pub fn y(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } #[doc = "Change the `z` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] pub fn z(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.z_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceLightEventInit.rs b/crates/web-sys/src/features/gen_DeviceLightEventInit.rs index a72b40dd4b4..61ab42345bb 100644 --- a/crates/web-sys/src/features/gen_DeviceLightEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceLightEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] pub type DeviceLightEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &DeviceLightEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &DeviceLightEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &DeviceLightEventInit, val: bool); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &DeviceLightEventInit, val: f64); } impl DeviceLightEventInit { #[doc = "Construct a new `DeviceLightEventInit`."] @@ -24,64 +32,28 @@ impl DeviceLightEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] pub fn value(&mut self, val: f64) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs b/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs index 38dc6b76f97..43ed16d21fe 100644 --- a/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs @@ -10,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] pub type DeviceMotionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &DeviceMotionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &DeviceMotionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &DeviceMotionEventInit, val: bool); + #[cfg(feature = "DeviceAccelerationInit")] + #[wasm_bindgen(method, setter = "acceleration")] + fn acceleration_shim(this: &DeviceMotionEventInit, val: &DeviceAccelerationInit); + #[cfg(feature = "DeviceAccelerationInit")] + #[wasm_bindgen(method, setter = "accelerationIncludingGravity")] + fn acceleration_including_gravity_shim( + this: &DeviceMotionEventInit, + val: &DeviceAccelerationInit, + ); + #[wasm_bindgen(method, setter = "interval")] + fn interval_shim(this: &DeviceMotionEventInit, val: Option); + #[cfg(feature = "DeviceRotationRateInit")] + #[wasm_bindgen(method, setter = "rotationRate")] + fn rotation_rate_shim(this: &DeviceMotionEventInit, val: &DeviceRotationRateInit); } impl DeviceMotionEventInit { #[doc = "Construct a new `DeviceMotionEventInit`."] @@ -24,51 +44,21 @@ impl DeviceMotionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "DeviceAccelerationInit")] @@ -76,17 +66,7 @@ impl DeviceMotionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] pub fn acceleration(&mut self, val: &DeviceAccelerationInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceleration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.acceleration_shim(val); self } #[cfg(feature = "DeviceAccelerationInit")] @@ -94,34 +74,14 @@ impl DeviceMotionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] pub fn acceleration_including_gravity(&mut self, val: &DeviceAccelerationInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("accelerationIncludingGravity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.acceleration_including_gravity_shim(val); self } #[doc = "Change the `interval` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] pub fn interval(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interval"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.interval_shim(val); self } #[cfg(feature = "DeviceRotationRateInit")] @@ -129,17 +89,7 @@ impl DeviceMotionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`, `DeviceRotationRateInit`*"] pub fn rotation_rate(&mut self, val: &DeviceRotationRateInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rotationRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rotation_rate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs b/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs index 5aec65d23de..0baef9e2c32 100644 --- a/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub type DeviceOrientationEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &DeviceOrientationEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &DeviceOrientationEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &DeviceOrientationEventInit, val: bool); + #[wasm_bindgen(method, setter = "absolute")] + fn absolute_shim(this: &DeviceOrientationEventInit, val: bool); + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &DeviceOrientationEventInit, val: Option); + #[wasm_bindgen(method, setter = "beta")] + fn beta_shim(this: &DeviceOrientationEventInit, val: Option); + #[wasm_bindgen(method, setter = "gamma")] + fn gamma_shim(this: &DeviceOrientationEventInit, val: Option); } impl DeviceOrientationEventInit { #[doc = "Construct a new `DeviceOrientationEventInit`."] @@ -24,107 +38,49 @@ impl DeviceOrientationEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `absolute` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn absolute(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("absolute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.absolute_shim(val); self } #[doc = "Change the `alpha` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn alpha(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[doc = "Change the `beta` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn beta(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("beta"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.beta_shim(val); self } #[doc = "Change the `gamma` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub fn gamma(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gamma"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gamma_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs b/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs index ab35b2e6a2e..f93f58341f8 100644 --- a/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub type DeviceProximityEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &DeviceProximityEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &DeviceProximityEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &DeviceProximityEventInit, val: bool); + #[wasm_bindgen(method, setter = "max")] + fn max_shim(this: &DeviceProximityEventInit, val: f64); + #[wasm_bindgen(method, setter = "min")] + fn min_shim(this: &DeviceProximityEventInit, val: f64); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &DeviceProximityEventInit, val: f64); } impl DeviceProximityEventInit { #[doc = "Construct a new `DeviceProximityEventInit`."] @@ -24,90 +36,42 @@ impl DeviceProximityEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `max` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub fn max(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("max"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_shim(val); self } #[doc = "Change the `min` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub fn min(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("min"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub fn value(&mut self, val: f64) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs b/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs index 7df806bca6a..5f8cf0a712a 100644 --- a/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs +++ b/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] pub type DeviceRotationRateInit; + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &DeviceRotationRateInit, val: Option); + #[wasm_bindgen(method, setter = "beta")] + fn beta_shim(this: &DeviceRotationRateInit, val: Option); + #[wasm_bindgen(method, setter = "gamma")] + fn gamma_shim(this: &DeviceRotationRateInit, val: Option); } impl DeviceRotationRateInit { #[doc = "Construct a new `DeviceRotationRateInit`."] @@ -24,39 +30,21 @@ impl DeviceRotationRateInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] pub fn alpha(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[doc = "Change the `beta` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] pub fn beta(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("beta"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.beta_shim(val); self } #[doc = "Change the `gamma` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] pub fn gamma(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gamma"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gamma_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs b/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs index 8a0ba9da5ff..a72d6f55817 100644 --- a/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs +++ b/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DhKeyDeriveParams`*"] pub type DhKeyDeriveParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &DhKeyDeriveParams, val: &str); + #[cfg(feature = "CryptoKey")] + #[wasm_bindgen(method, setter = "public")] + fn public_shim(this: &DhKeyDeriveParams, val: &CryptoKey); } impl DhKeyDeriveParams { #[cfg(feature = "CryptoKey")] @@ -27,13 +32,7 @@ impl DhKeyDeriveParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DhKeyDeriveParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(feature = "CryptoKey")] @@ -41,14 +40,7 @@ impl DhKeyDeriveParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `DhKeyDeriveParams`*"] pub fn public(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("public"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.public_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs b/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs index a7886ebc0be..5abcb4cedb6 100644 --- a/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs +++ b/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs @@ -14,6 +14,13 @@ 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 type DirectoryPickerOptions; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &DirectoryPickerOptions, val: &str); + #[cfg(feature = "FileSystemPermissionMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &DirectoryPickerOptions, val: FileSystemPermissionMode); + #[wasm_bindgen(method, setter = "startIn")] + fn start_in_shim(this: &DirectoryPickerOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl DirectoryPickerOptions { @@ -36,13 +43,7 @@ impl DirectoryPickerOptions { #[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 id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,13 +55,7 @@ impl DirectoryPickerOptions { #[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 mode(&mut self, val: FileSystemPermissionMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -71,17 +66,7 @@ impl DirectoryPickerOptions { #[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 start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startIn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.start_in_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs b/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs index 9f80d9a29f3..993d493b46d 100644 --- a/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs +++ b/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] pub type DisplayMediaStreamConstraints; + #[wasm_bindgen(method, setter = "audio")] + fn audio_shim(this: &DisplayMediaStreamConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "video")] + fn video_shim(this: &DisplayMediaStreamConstraints, val: &::wasm_bindgen::JsValue); } impl DisplayMediaStreamConstraints { #[doc = "Construct a new `DisplayMediaStreamConstraints`."] @@ -24,26 +28,14 @@ impl DisplayMediaStreamConstraints { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] pub fn audio(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_shim(val); self } #[doc = "Change the `video` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] pub fn video(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DisplayNameOptions.rs b/crates/web-sys/src/features/gen_DisplayNameOptions.rs index 1dec81b9f82..bddb9923a34 100644 --- a/crates/web-sys/src/features/gen_DisplayNameOptions.rs +++ b/crates/web-sys/src/features/gen_DisplayNameOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] pub type DisplayNameOptions; + #[wasm_bindgen(method, setter = "keys")] + fn keys_shim(this: &DisplayNameOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "style")] + fn style_shim(this: &DisplayNameOptions, val: &str); } impl DisplayNameOptions { #[doc = "Construct a new `DisplayNameOptions`."] @@ -24,26 +28,14 @@ impl DisplayNameOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] pub fn keys(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("keys"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.keys_shim(val); self } #[doc = "Change the `style` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] pub fn style(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("style"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.style_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DisplayNameResult.rs b/crates/web-sys/src/features/gen_DisplayNameResult.rs index d13291047ab..fcee8ccffb2 100644 --- a/crates/web-sys/src/features/gen_DisplayNameResult.rs +++ b/crates/web-sys/src/features/gen_DisplayNameResult.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] pub type DisplayNameResult; + #[wasm_bindgen(method, setter = "locale")] + fn locale_shim(this: &DisplayNameResult, val: &str); + #[wasm_bindgen(method, setter = "style")] + fn style_shim(this: &DisplayNameResult, val: &str); } impl DisplayNameResult { #[doc = "Construct a new `DisplayNameResult`."] @@ -24,27 +28,14 @@ impl DisplayNameResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] pub fn locale(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("locale"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.locale_shim(val); self } #[doc = "Change the `style` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] pub fn style(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("style"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.style_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DnsCacheDict.rs b/crates/web-sys/src/features/gen_DnsCacheDict.rs index 32cbbf5fbb9..e16b2c6b833 100644 --- a/crates/web-sys/src/features/gen_DnsCacheDict.rs +++ b/crates/web-sys/src/features/gen_DnsCacheDict.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheDict`*"] pub type DnsCacheDict; + #[wasm_bindgen(method, setter = "entries")] + fn entries_shim(this: &DnsCacheDict, val: &::wasm_bindgen::JsValue); } impl DnsCacheDict { #[doc = "Construct a new `DnsCacheDict`."] @@ -24,17 +26,7 @@ impl DnsCacheDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheDict`*"] pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entries_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DnsCacheEntry.rs b/crates/web-sys/src/features/gen_DnsCacheEntry.rs index a368929bd4c..ad86c2a5b0e 100644 --- a/crates/web-sys/src/features/gen_DnsCacheEntry.rs +++ b/crates/web-sys/src/features/gen_DnsCacheEntry.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub type DnsCacheEntry; + #[wasm_bindgen(method, setter = "expiration")] + fn expiration_shim(this: &DnsCacheEntry, val: f64); + #[wasm_bindgen(method, setter = "family")] + fn family_shim(this: &DnsCacheEntry, val: &str); + #[wasm_bindgen(method, setter = "hostaddr")] + fn hostaddr_shim(this: &DnsCacheEntry, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "hostname")] + fn hostname_shim(this: &DnsCacheEntry, val: &str); + #[wasm_bindgen(method, setter = "trr")] + fn trr_shim(this: &DnsCacheEntry, val: bool); } impl DnsCacheEntry { #[doc = "Construct a new `DnsCacheEntry`."] @@ -24,78 +34,35 @@ impl DnsCacheEntry { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub fn expiration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expiration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.expiration_shim(val); self } #[doc = "Change the `family` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub fn family(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("family"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.family_shim(val); self } #[doc = "Change the `hostaddr` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub fn hostaddr(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hostaddr"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hostaddr_shim(val); self } #[doc = "Change the `hostname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub fn hostname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hostname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hostname_shim(val); self } #[doc = "Change the `trr` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub fn trr(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("trr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.trr_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DnsLookupDict.rs b/crates/web-sys/src/features/gen_DnsLookupDict.rs index c9ecc81a091..22e646160e8 100644 --- a/crates/web-sys/src/features/gen_DnsLookupDict.rs +++ b/crates/web-sys/src/features/gen_DnsLookupDict.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] pub type DnsLookupDict; + #[wasm_bindgen(method, setter = "address")] + fn address_shim(this: &DnsLookupDict, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "answer")] + fn answer_shim(this: &DnsLookupDict, val: bool); + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &DnsLookupDict, val: &str); } impl DnsLookupDict { #[doc = "Construct a new `DnsLookupDict`."] @@ -24,44 +30,21 @@ impl DnsLookupDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] pub fn address(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("address"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.address_shim(val); self } #[doc = "Change the `answer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] pub fn answer(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("answer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.answer_shim(val); self } #[doc = "Change the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] pub fn error(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs b/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs index 7fa2dedc2ec..5cbf8c1a181 100644 --- a/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs +++ b/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DocumentTimelineOptions`*"] pub type DocumentTimelineOptions; + #[wasm_bindgen(method, setter = "originTime")] + fn origin_time_shim(this: &DocumentTimelineOptions, val: f64); } impl DocumentTimelineOptions { #[doc = "Construct a new `DocumentTimelineOptions`."] @@ -24,17 +26,7 @@ impl DocumentTimelineOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DocumentTimelineOptions`*"] pub fn origin_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("originTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomMatrix2dInit.rs b/crates/web-sys/src/features/gen_DomMatrix2dInit.rs index f91b401cec6..d93e11a0eb9 100644 --- a/crates/web-sys/src/features/gen_DomMatrix2dInit.rs +++ b/crates/web-sys/src/features/gen_DomMatrix2dInit.rs @@ -10,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub type DomMatrix2dInit; + #[wasm_bindgen(method, setter = "a")] + fn a_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "b")] + fn b_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "c")] + fn c_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "d")] + fn d_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "e")] + fn e_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "f")] + fn f_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "m11")] + fn m11_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "m12")] + fn m12_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "m21")] + fn m21_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "m22")] + fn m22_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "m41")] + fn m41_shim(this: &DomMatrix2dInit, val: f64); + #[wasm_bindgen(method, setter = "m42")] + fn m42_shim(this: &DomMatrix2dInit, val: f64); } impl DomMatrix2dInit { #[doc = "Construct a new `DomMatrix2dInit`."] @@ -24,156 +48,84 @@ impl DomMatrix2dInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn a(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("a"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.a_shim(val); self } #[doc = "Change the `b` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn b(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("b"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.b_shim(val); self } #[doc = "Change the `c` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn c(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("c"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.c_shim(val); self } #[doc = "Change the `d` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn d(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.d_shim(val); self } #[doc = "Change the `e` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn e(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("e"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.e_shim(val); self } #[doc = "Change the `f` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn f(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("f"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.f_shim(val); self } #[doc = "Change the `m11` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn m11(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m11"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m11_shim(val); self } #[doc = "Change the `m12` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn m12(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m12"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m12_shim(val); self } #[doc = "Change the `m21` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn m21(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m21"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m21_shim(val); self } #[doc = "Change the `m22` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn m22(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m22"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m22_shim(val); self } #[doc = "Change the `m41` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn m41(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m41"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m41_shim(val); self } #[doc = "Change the `m42` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] pub fn m42(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m42"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m42_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomMatrixInit.rs b/crates/web-sys/src/features/gen_DomMatrixInit.rs index 573a0c4d65e..f1dbe993864 100644 --- a/crates/web-sys/src/features/gen_DomMatrixInit.rs +++ b/crates/web-sys/src/features/gen_DomMatrixInit.rs @@ -10,6 +10,52 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub type DomMatrixInit; + #[wasm_bindgen(method, setter = "a")] + fn a_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "b")] + fn b_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "c")] + fn c_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "d")] + fn d_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "e")] + fn e_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "f")] + fn f_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m11")] + fn m11_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m12")] + fn m12_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m21")] + fn m21_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m22")] + fn m22_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m41")] + fn m41_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m42")] + fn m42_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "is2D")] + fn is_2d_shim(this: &DomMatrixInit, val: bool); + #[wasm_bindgen(method, setter = "m13")] + fn m13_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m14")] + fn m14_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m23")] + fn m23_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m24")] + fn m24_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m31")] + fn m31_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m32")] + fn m32_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m33")] + fn m33_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m34")] + fn m34_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m43")] + fn m43_shim(this: &DomMatrixInit, val: f64); + #[wasm_bindgen(method, setter = "m44")] + fn m44_shim(this: &DomMatrixInit, val: f64); } impl DomMatrixInit { #[doc = "Construct a new `DomMatrixInit`."] @@ -24,299 +70,161 @@ impl DomMatrixInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn a(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("a"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.a_shim(val); self } #[doc = "Change the `b` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn b(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("b"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.b_shim(val); self } #[doc = "Change the `c` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn c(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("c"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.c_shim(val); self } #[doc = "Change the `d` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn d(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.d_shim(val); self } #[doc = "Change the `e` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn e(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("e"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.e_shim(val); self } #[doc = "Change the `f` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn f(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("f"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.f_shim(val); self } #[doc = "Change the `m11` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m11(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m11"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m11_shim(val); self } #[doc = "Change the `m12` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m12(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m12"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m12_shim(val); self } #[doc = "Change the `m21` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m21(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m21"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m21_shim(val); self } #[doc = "Change the `m22` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m22(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m22"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m22_shim(val); self } #[doc = "Change the `m41` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m41(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m41"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m41_shim(val); self } #[doc = "Change the `m42` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m42(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m42"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m42_shim(val); self } #[doc = "Change the `is2D` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn is_2d(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("is2D"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_2d_shim(val); self } #[doc = "Change the `m13` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m13(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m13"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m13_shim(val); self } #[doc = "Change the `m14` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m14(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m14"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m14_shim(val); self } #[doc = "Change the `m23` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m23(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m23"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m23_shim(val); self } #[doc = "Change the `m24` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m24(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m24"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m24_shim(val); self } #[doc = "Change the `m31` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m31(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m31"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m31_shim(val); self } #[doc = "Change the `m32` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m32(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m32"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m32_shim(val); self } #[doc = "Change the `m33` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m33(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m33"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m33_shim(val); self } #[doc = "Change the `m34` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m34(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m34"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m34_shim(val); self } #[doc = "Change the `m43` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m43(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m43"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m43_shim(val); self } #[doc = "Change the `m44` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] pub fn m44(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("m44"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.m44_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomPointInit.rs b/crates/web-sys/src/features/gen_DomPointInit.rs index b909aaf3981..37f3064eb47 100644 --- a/crates/web-sys/src/features/gen_DomPointInit.rs +++ b/crates/web-sys/src/features/gen_DomPointInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] pub type DomPointInit; + #[wasm_bindgen(method, setter = "w")] + fn w_shim(this: &DomPointInit, val: f64); + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &DomPointInit, val: f64); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &DomPointInit, val: f64); + #[wasm_bindgen(method, setter = "z")] + fn z_shim(this: &DomPointInit, val: f64); } impl DomPointInit { #[doc = "Construct a new `DomPointInit`."] @@ -24,52 +32,28 @@ impl DomPointInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] pub fn w(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("w"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.w_shim(val); self } #[doc = "Change the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] pub fn x(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[doc = "Change the `y` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] pub fn y(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } #[doc = "Change the `z` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] pub fn z(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.z_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomQuadInit.rs b/crates/web-sys/src/features/gen_DomQuadInit.rs index b85560d8491..b9af8996627 100644 --- a/crates/web-sys/src/features/gen_DomQuadInit.rs +++ b/crates/web-sys/src/features/gen_DomQuadInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomQuadInit`*"] pub type DomQuadInit; + #[cfg(feature = "DomPointInit")] + #[wasm_bindgen(method, setter = "p1")] + fn p1_shim(this: &DomQuadInit, val: &DomPointInit); + #[cfg(feature = "DomPointInit")] + #[wasm_bindgen(method, setter = "p2")] + fn p2_shim(this: &DomQuadInit, val: &DomPointInit); + #[cfg(feature = "DomPointInit")] + #[wasm_bindgen(method, setter = "p3")] + fn p3_shim(this: &DomQuadInit, val: &DomPointInit); + #[cfg(feature = "DomPointInit")] + #[wasm_bindgen(method, setter = "p4")] + fn p4_shim(this: &DomQuadInit, val: &DomPointInit); } impl DomQuadInit { #[doc = "Construct a new `DomQuadInit`."] @@ -25,13 +37,7 @@ impl DomQuadInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] pub fn p1(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p1_shim(val); self } #[cfg(feature = "DomPointInit")] @@ -39,13 +45,7 @@ impl DomQuadInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] pub fn p2(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p2_shim(val); self } #[cfg(feature = "DomPointInit")] @@ -53,13 +53,7 @@ impl DomQuadInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] pub fn p3(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p3"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p3_shim(val); self } #[cfg(feature = "DomPointInit")] @@ -67,13 +61,7 @@ impl DomQuadInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] pub fn p4(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p4"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p4_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomQuadJson.rs b/crates/web-sys/src/features/gen_DomQuadJson.rs index 95189b208db..d02f9daa85d 100644 --- a/crates/web-sys/src/features/gen_DomQuadJson.rs +++ b/crates/web-sys/src/features/gen_DomQuadJson.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomQuadJson`*"] pub type DomQuadJson; + #[cfg(feature = "DomPoint")] + #[wasm_bindgen(method, setter = "p1")] + fn p1_shim(this: &DomQuadJson, val: &DomPoint); + #[cfg(feature = "DomPoint")] + #[wasm_bindgen(method, setter = "p2")] + fn p2_shim(this: &DomQuadJson, val: &DomPoint); + #[cfg(feature = "DomPoint")] + #[wasm_bindgen(method, setter = "p3")] + fn p3_shim(this: &DomQuadJson, val: &DomPoint); + #[cfg(feature = "DomPoint")] + #[wasm_bindgen(method, setter = "p4")] + fn p4_shim(this: &DomQuadJson, val: &DomPoint); } impl DomQuadJson { #[doc = "Construct a new `DomQuadJson`."] @@ -25,13 +37,7 @@ impl DomQuadJson { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] pub fn p1(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p1_shim(val); self } #[cfg(feature = "DomPoint")] @@ -39,13 +45,7 @@ impl DomQuadJson { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] pub fn p2(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p2_shim(val); self } #[cfg(feature = "DomPoint")] @@ -53,13 +53,7 @@ impl DomQuadJson { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] pub fn p3(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p3"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p3_shim(val); self } #[cfg(feature = "DomPoint")] @@ -67,13 +61,7 @@ impl DomQuadJson { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] pub fn p4(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p4"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p4_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomRectInit.rs b/crates/web-sys/src/features/gen_DomRectInit.rs index ec514d0f6fb..2124c443bc8 100644 --- a/crates/web-sys/src/features/gen_DomRectInit.rs +++ b/crates/web-sys/src/features/gen_DomRectInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] pub type DomRectInit; + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &DomRectInit, val: f64); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &DomRectInit, val: f64); + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &DomRectInit, val: f64); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &DomRectInit, val: f64); } impl DomRectInit { #[doc = "Construct a new `DomRectInit`."] @@ -24,53 +32,28 @@ impl DomRectInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] pub fn height(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] pub fn width(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } #[doc = "Change the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] pub fn x(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[doc = "Change the `y` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] pub fn y(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs b/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs index 6e3ca630712..584b0f9acc1 100644 --- a/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs +++ b/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] pub type DomWindowResizeEventDetail; + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &DomWindowResizeEventDetail, val: i32); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &DomWindowResizeEventDetail, val: i32); } impl DomWindowResizeEventDetail { #[doc = "Construct a new `DomWindowResizeEventDetail`."] @@ -24,27 +28,14 @@ impl DomWindowResizeEventDetail { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DragEventInit.rs b/crates/web-sys/src/features/gen_DragEventInit.rs index 821a5f5ed51..0b50bf3a4b9 100644 --- a/crates/web-sys/src/features/gen_DragEventInit.rs +++ b/crates/web-sys/src/features/gen_DragEventInit.rs @@ -10,6 +10,65 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub type DragEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &DragEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &DragEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &DragEventInit, val: bool); + #[wasm_bindgen(method, setter = "button")] + fn button_shim(this: &DragEventInit, val: i16); + #[wasm_bindgen(method, setter = "buttons")] + fn buttons_shim(this: &DragEventInit, val: u16); + #[wasm_bindgen(method, setter = "clientX")] + fn client_x_shim(this: &DragEventInit, val: i32); + #[wasm_bindgen(method, setter = "clientY")] + fn client_y_shim(this: &DragEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementX")] + fn movement_x_shim(this: &DragEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementY")] + fn movement_y_shim(this: &DragEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[wasm_bindgen(method, setter = "relatedTarget")] + fn related_target_shim(this: &DragEventInit, val: Option<&EventTarget>); + #[wasm_bindgen(method, setter = "screenX")] + fn screen_x_shim(this: &DragEventInit, val: i32); + #[wasm_bindgen(method, setter = "screenY")] + fn screen_y_shim(this: &DragEventInit, val: i32); + #[cfg(feature = "DataTransfer")] + #[wasm_bindgen(method, setter = "dataTransfer")] + fn data_transfer_shim(this: &DragEventInit, val: Option<&DataTransfer>); } impl DragEventInit { #[doc = "Construct a new `DragEventInit`."] @@ -24,65 +83,28 @@ impl DragEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,330 +112,140 @@ impl DragEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } #[doc = "Change the `button` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.button_shim(val); self } #[doc = "Change the `buttons` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buttons_shim(val); self } #[doc = "Change the `clientX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_x_shim(val); self } #[doc = "Change the `clientY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_y_shim(val); self } #[doc = "Change the `movementX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_x_shim(val); self } #[doc = "Change the `movementY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_y_shim(val); self } #[cfg(feature = "EventTarget")] @@ -421,51 +253,21 @@ impl DragEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `EventTarget`*"] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.related_target_shim(val); self } #[doc = "Change the `screenX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_x_shim(val); self } #[doc = "Change the `screenY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_y_shim(val); self } #[cfg(feature = "DataTransfer")] @@ -473,17 +275,7 @@ impl DragEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `DragEventInit`*"] pub fn data_transfer(&mut self, val: Option<&DataTransfer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataTransfer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_transfer_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs b/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs index 788f593548e..494ed0224eb 100644 --- a/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs +++ b/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub type DynamicsCompressorOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &DynamicsCompressorOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &DynamicsCompressorOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &DynamicsCompressorOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "attack")] + fn attack_shim(this: &DynamicsCompressorOptions, val: f32); + #[wasm_bindgen(method, setter = "knee")] + fn knee_shim(this: &DynamicsCompressorOptions, val: f32); + #[wasm_bindgen(method, setter = "ratio")] + fn ratio_shim(this: &DynamicsCompressorOptions, val: f32); + #[wasm_bindgen(method, setter = "release")] + fn release_shim(this: &DynamicsCompressorOptions, val: f32); + #[wasm_bindgen(method, setter = "threshold")] + fn threshold_shim(this: &DynamicsCompressorOptions, val: f32); } impl DynamicsCompressorOptions { #[doc = "Construct a new `DynamicsCompressorOptions`."] @@ -24,17 +42,7 @@ impl DynamicsCompressorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +50,7 @@ impl DynamicsCompressorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DynamicsCompressorOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,91 +58,42 @@ impl DynamicsCompressorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DynamicsCompressorOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `attack` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub fn attack(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("attack"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attack_shim(val); self } #[doc = "Change the `knee` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub fn knee(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("knee"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.knee_shim(val); self } #[doc = "Change the `ratio` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub fn ratio(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ratio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ratio_shim(val); self } #[doc = "Change the `release` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub fn release(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("release"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.release_shim(val); self } #[doc = "Change the `threshold` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub fn threshold(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("threshold"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.threshold_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs b/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs index 42aad21d531..82ca2870a12 100644 --- a/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] pub type EcKeyAlgorithm; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &EcKeyAlgorithm, val: &str); + #[wasm_bindgen(method, setter = "namedCurve")] + fn named_curve_shim(this: &EcKeyAlgorithm, val: &str); } impl EcKeyAlgorithm { #[doc = "Construct a new `EcKeyAlgorithm`."] @@ -26,30 +30,14 @@ impl EcKeyAlgorithm { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `namedCurve` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] pub fn named_curve(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namedCurve"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.named_curve_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EcKeyGenParams.rs b/crates/web-sys/src/features/gen_EcKeyGenParams.rs index 05c7d2378b5..08ffc99e257 100644 --- a/crates/web-sys/src/features/gen_EcKeyGenParams.rs +++ b/crates/web-sys/src/features/gen_EcKeyGenParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] pub type EcKeyGenParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &EcKeyGenParams, val: &str); + #[wasm_bindgen(method, setter = "namedCurve")] + fn named_curve_shim(this: &EcKeyGenParams, val: &str); } impl EcKeyGenParams { #[doc = "Construct a new `EcKeyGenParams`."] @@ -26,30 +30,14 @@ impl EcKeyGenParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `namedCurve` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] pub fn named_curve(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namedCurve"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.named_curve_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EcKeyImportParams.rs b/crates/web-sys/src/features/gen_EcKeyImportParams.rs index 13615f0888f..512dee8819d 100644 --- a/crates/web-sys/src/features/gen_EcKeyImportParams.rs +++ b/crates/web-sys/src/features/gen_EcKeyImportParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] pub type EcKeyImportParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &EcKeyImportParams, val: &str); + #[wasm_bindgen(method, setter = "namedCurve")] + fn named_curve_shim(this: &EcKeyImportParams, val: &str); } impl EcKeyImportParams { #[doc = "Construct a new `EcKeyImportParams`."] @@ -25,30 +29,14 @@ impl EcKeyImportParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `namedCurve` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] pub fn named_curve(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namedCurve"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.named_curve_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs b/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs index 2f6c4d694b5..c01ec76a8e2 100644 --- a/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs +++ b/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"] pub type EcdhKeyDeriveParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &EcdhKeyDeriveParams, val: &str); + #[cfg(feature = "CryptoKey")] + #[wasm_bindgen(method, setter = "public")] + fn public_shim(this: &EcdhKeyDeriveParams, val: &CryptoKey); } impl EcdhKeyDeriveParams { #[cfg(feature = "CryptoKey")] @@ -27,13 +32,7 @@ impl EcdhKeyDeriveParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(feature = "CryptoKey")] @@ -41,14 +40,7 @@ impl EcdhKeyDeriveParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `EcdhKeyDeriveParams`*"] pub fn public(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("public"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.public_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EcdsaParams.rs b/crates/web-sys/src/features/gen_EcdsaParams.rs index 918c40523c5..bfc9fe093fc 100644 --- a/crates/web-sys/src/features/gen_EcdsaParams.rs +++ b/crates/web-sys/src/features/gen_EcdsaParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] pub type EcdsaParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &EcdsaParams, val: &str); + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &EcdsaParams, val: &::wasm_bindgen::JsValue); } impl EcdsaParams { #[doc = "Construct a new `EcdsaParams`."] @@ -26,26 +30,14 @@ impl EcdsaParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `hash` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EffectTiming.rs b/crates/web-sys/src/features/gen_EffectTiming.rs index 4af14f8f347..cd1b84ecfb7 100644 --- a/crates/web-sys/src/features/gen_EffectTiming.rs +++ b/crates/web-sys/src/features/gen_EffectTiming.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub type EffectTiming; + #[wasm_bindgen(method, setter = "delay")] + fn delay_shim(this: &EffectTiming, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &EffectTiming, val: PlaybackDirection); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &EffectTiming, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &EffectTiming, val: &str); + #[wasm_bindgen(method, setter = "endDelay")] + fn end_delay_shim(this: &EffectTiming, val: f64); + #[cfg(feature = "FillMode")] + #[wasm_bindgen(method, setter = "fill")] + fn fill_shim(this: &EffectTiming, val: FillMode); + #[wasm_bindgen(method, setter = "iterationStart")] + fn iteration_start_shim(this: &EffectTiming, val: f64); + #[wasm_bindgen(method, setter = "iterations")] + fn iterations_shim(this: &EffectTiming, val: f64); } impl EffectTiming { #[doc = "Construct a new `EffectTiming`."] @@ -24,13 +42,7 @@ impl EffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_shim(val); self } #[cfg(feature = "PlaybackDirection")] @@ -38,65 +50,28 @@ impl EffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `PlaybackDirection`*"] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[doc = "Change the `duration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `endDelay` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_delay_shim(val); self } #[cfg(feature = "FillMode")] @@ -104,47 +79,21 @@ impl EffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `FillMode`*"] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fill_shim(val); self } #[doc = "Change the `iterationStart` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_start_shim(val); self } #[doc = "Change the `iterations` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iterations_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ElementCreationOptions.rs b/crates/web-sys/src/features/gen_ElementCreationOptions.rs index b5a76b5c074..59bd3c85d11 100644 --- a/crates/web-sys/src/features/gen_ElementCreationOptions.rs +++ b/crates/web-sys/src/features/gen_ElementCreationOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] pub type ElementCreationOptions; + #[wasm_bindgen(method, setter = "is")] + fn is_shim(this: &ElementCreationOptions, val: &str); + #[wasm_bindgen(method, setter = "pseudo")] + fn pseudo_shim(this: &ElementCreationOptions, val: &str); } impl ElementCreationOptions { #[doc = "Construct a new `ElementCreationOptions`."] @@ -24,27 +28,14 @@ impl ElementCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] pub fn is(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("is"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_shim(val); self } #[doc = "Change the `pseudo` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] pub fn pseudo(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pseudo"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pseudo_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs b/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs index e53766d8648..0c551a1c06f 100644 --- a/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs +++ b/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementDefinitionOptions`*"] pub type ElementDefinitionOptions; + #[wasm_bindgen(method, setter = "extends")] + fn extends_shim(this: &ElementDefinitionOptions, val: &str); } impl ElementDefinitionOptions { #[doc = "Construct a new `ElementDefinitionOptions`."] @@ -24,17 +26,7 @@ impl ElementDefinitionOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementDefinitionOptions`*"] pub fn extends(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extends"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.extends_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs b/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs index d5496c324e2..089dd9bb426 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs @@ -14,6 +14,15 @@ 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 type EncodedAudioChunkInit; + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &EncodedAudioChunkInit, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &EncodedAudioChunkInit, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &EncodedAudioChunkInit, val: f64); + #[cfg(feature = "EncodedAudioChunkType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &EncodedAudioChunkInit, val: EncodedAudioChunkType); } #[cfg(web_sys_unstable_apis)] impl EncodedAudioChunkInit { @@ -40,13 +49,7 @@ impl EncodedAudioChunkInit { #[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 data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +60,7 @@ impl EncodedAudioChunkInit { #[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 duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +71,7 @@ impl EncodedAudioChunkInit { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,13 +83,7 @@ impl EncodedAudioChunkInit { #[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 type_(&mut self, val: EncodedAudioChunkType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs b/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs index aeb9cd53201..a5da12d42dd 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs @@ -14,6 +14,9 @@ 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 type EncodedAudioChunkMetadata; + #[cfg(feature = "AudioDecoderConfig")] + #[wasm_bindgen(method, setter = "decoderConfig")] + fn decoder_config_shim(this: &EncodedAudioChunkMetadata, val: &AudioDecoderConfig); } #[cfg(web_sys_unstable_apis)] impl EncodedAudioChunkMetadata { @@ -37,17 +40,7 @@ impl EncodedAudioChunkMetadata { #[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 decoder_config(&mut self, val: &AudioDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decoderConfig"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.decoder_config_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs b/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs index 1699fbf104a..7d8da29fee1 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs @@ -14,6 +14,15 @@ 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 type EncodedVideoChunkInit; + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &EncodedVideoChunkInit, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &EncodedVideoChunkInit, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &EncodedVideoChunkInit, val: f64); + #[cfg(feature = "EncodedVideoChunkType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &EncodedVideoChunkInit, val: EncodedVideoChunkType); } #[cfg(web_sys_unstable_apis)] impl EncodedVideoChunkInit { @@ -40,13 +49,7 @@ impl EncodedVideoChunkInit { #[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 data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +60,7 @@ impl EncodedVideoChunkInit { #[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 duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +71,7 @@ impl EncodedVideoChunkInit { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,13 +83,7 @@ impl EncodedVideoChunkInit { #[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 type_(&mut self, val: EncodedVideoChunkType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs b/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs index 6b81fe2e3e7..354fb8dc070 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs @@ -14,6 +14,14 @@ 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 type EncodedVideoChunkMetadata; + #[wasm_bindgen(method, setter = "alphaSideData")] + fn alpha_side_data_shim(this: &EncodedVideoChunkMetadata, val: &::js_sys::Object); + #[cfg(feature = "VideoDecoderConfig")] + #[wasm_bindgen(method, setter = "decoderConfig")] + fn decoder_config_shim(this: &EncodedVideoChunkMetadata, val: &VideoDecoderConfig); + #[cfg(feature = "SvcOutputMetadata")] + #[wasm_bindgen(method, setter = "svc")] + fn svc_shim(this: &EncodedVideoChunkMetadata, val: &SvcOutputMetadata); } #[cfg(web_sys_unstable_apis)] impl EncodedVideoChunkMetadata { @@ -36,17 +44,7 @@ impl EncodedVideoChunkMetadata { #[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 alpha_side_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaSideData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_side_data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +56,7 @@ impl EncodedVideoChunkMetadata { #[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 decoder_config(&mut self, val: &VideoDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decoderConfig"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.decoder_config_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,13 +68,7 @@ impl EncodedVideoChunkMetadata { #[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 svc(&mut self, val: &SvcOutputMetadata) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("svc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.svc_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ErrorCallback.rs b/crates/web-sys/src/features/gen_ErrorCallback.rs index 4351dfc05eb..e14346d2eae 100644 --- a/crates/web-sys/src/features/gen_ErrorCallback.rs +++ b/crates/web-sys/src/features/gen_ErrorCallback.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorCallback`*"] pub type ErrorCallback; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &ErrorCallback, val: &::js_sys::Function); } impl ErrorCallback { #[doc = "Construct a new `ErrorCallback`."] @@ -24,17 +26,7 @@ impl ErrorCallback { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorCallback`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ErrorEventInit.rs b/crates/web-sys/src/features/gen_ErrorEventInit.rs index c483439e562..42369ecc8a4 100644 --- a/crates/web-sys/src/features/gen_ErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_ErrorEventInit.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub type ErrorEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "colno")] + fn colno_shim(this: &ErrorEventInit, val: u32); + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &ErrorEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "filename")] + fn filename_shim(this: &ErrorEventInit, val: &str); + #[wasm_bindgen(method, setter = "lineno")] + fn lineno_shim(this: &ErrorEventInit, val: u32); + #[wasm_bindgen(method, setter = "message")] + fn message_shim(this: &ErrorEventInit, val: &str); } impl ErrorEventInit { #[doc = "Construct a new `ErrorEventInit`."] @@ -24,125 +40,56 @@ impl ErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `colno` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn colno(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("colno"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.colno_shim(val); self } #[doc = "Change the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn error(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[doc = "Change the `filename` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn filename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filename_shim(val); self } #[doc = "Change the `lineno` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn lineno(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("lineno"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lineno_shim(val); self } #[doc = "Change the `message` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EventInit.rs b/crates/web-sys/src/features/gen_EventInit.rs index 0a6e9eb812c..de8e524324e 100644 --- a/crates/web-sys/src/features/gen_EventInit.rs +++ b/crates/web-sys/src/features/gen_EventInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] pub type EventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &EventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &EventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &EventInit, val: bool); } impl EventInit { #[doc = "Construct a new `EventInit`."] @@ -24,51 +30,21 @@ impl EventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EventListener.rs b/crates/web-sys/src/features/gen_EventListener.rs index ab47a427340..8a17381cb56 100644 --- a/crates/web-sys/src/features/gen_EventListener.rs +++ b/crates/web-sys/src/features/gen_EventListener.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventListener`*"] pub type EventListener; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &EventListener, val: &::js_sys::Function); } impl EventListener { #[doc = "Construct a new `EventListener`."] @@ -24,17 +26,7 @@ impl EventListener { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventListener`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EventListenerOptions.rs b/crates/web-sys/src/features/gen_EventListenerOptions.rs index 4ac4ff613e5..05b771d7084 100644 --- a/crates/web-sys/src/features/gen_EventListenerOptions.rs +++ b/crates/web-sys/src/features/gen_EventListenerOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventListenerOptions`*"] pub type EventListenerOptions; + #[wasm_bindgen(method, setter = "capture")] + fn capture_shim(this: &EventListenerOptions, val: bool); } impl EventListenerOptions { #[doc = "Construct a new `EventListenerOptions`."] @@ -24,17 +26,7 @@ impl EventListenerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventListenerOptions`*"] pub fn capture(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("capture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.capture_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EventModifierInit.rs b/crates/web-sys/src/features/gen_EventModifierInit.rs index 21f7c2ceb81..373609a21ec 100644 --- a/crates/web-sys/src/features/gen_EventModifierInit.rs +++ b/crates/web-sys/src/features/gen_EventModifierInit.rs @@ -10,6 +10,43 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub type EventModifierInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &EventModifierInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &EventModifierInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &EventModifierInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &EventModifierInit, val: bool); } impl EventModifierInit { #[doc = "Construct a new `EventModifierInit`."] @@ -24,65 +61,28 @@ impl EventModifierInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,231 +90,98 @@ impl EventModifierInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_EventSourceInit.rs b/crates/web-sys/src/features/gen_EventSourceInit.rs index 7c0f3bce237..61761803dee 100644 --- a/crates/web-sys/src/features/gen_EventSourceInit.rs +++ b/crates/web-sys/src/features/gen_EventSourceInit.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventSourceInit`*"] pub type EventSourceInit; + #[wasm_bindgen(method, setter = "withCredentials")] + fn with_credentials_shim(this: &EventSourceInit, val: bool); } impl EventSourceInit { #[doc = "Construct a new `EventSourceInit`."] @@ -24,17 +26,7 @@ impl EventSourceInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventSourceInit`*"] pub fn with_credentials(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("withCredentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.with_credentials_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ExtendableEventInit.rs b/crates/web-sys/src/features/gen_ExtendableEventInit.rs index c990714268d..1dbc56a64f7 100644 --- a/crates/web-sys/src/features/gen_ExtendableEventInit.rs +++ b/crates/web-sys/src/features/gen_ExtendableEventInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] pub type ExtendableEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ExtendableEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ExtendableEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ExtendableEventInit, val: bool); } impl ExtendableEventInit { #[doc = "Construct a new `ExtendableEventInit`."] @@ -24,51 +30,21 @@ impl ExtendableEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs b/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs index 9be6c91c360..32c11651574 100644 --- a/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub type ExtendableMessageEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ExtendableMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ExtendableMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ExtendableMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &ExtendableMessageEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "lastEventId")] + fn last_event_id_shim(this: &ExtendableMessageEventInit, val: &str); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &ExtendableMessageEventInit, val: &str); + #[wasm_bindgen(method, setter = "ports")] + fn ports_shim(this: &ExtendableMessageEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &ExtendableMessageEventInit, val: Option<&::js_sys::Object>); } impl ExtendableMessageEventInit { #[doc = "Construct a new `ExtendableMessageEventInit`."] @@ -24,122 +40,56 @@ impl ExtendableMessageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[doc = "Change the `lastEventId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn last_event_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastEventId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_event_id_shim(val); self } #[doc = "Change the `origin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[doc = "Change the `ports` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ports"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ports_shim(val); self } #[doc = "Change the `source` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs b/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs index fbae627901c..2d3e8407ce1 100644 --- a/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs +++ b/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] pub type FakePluginMimeEntry; + #[wasm_bindgen(method, setter = "description")] + fn description_shim(this: &FakePluginMimeEntry, val: &str); + #[wasm_bindgen(method, setter = "extension")] + fn extension_shim(this: &FakePluginMimeEntry, val: &str); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &FakePluginMimeEntry, val: &str); } impl FakePluginMimeEntry { #[doc = "Construct a new `FakePluginMimeEntry`."] @@ -25,47 +31,21 @@ impl FakePluginMimeEntry { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] pub fn description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.description_shim(val); self } #[doc = "Change the `extension` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] pub fn extension(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.extension_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FakePluginTagInit.rs b/crates/web-sys/src/features/gen_FakePluginTagInit.rs index a1b4ac8a3f4..83d998c2dde 100644 --- a/crates/web-sys/src/features/gen_FakePluginTagInit.rs +++ b/crates/web-sys/src/features/gen_FakePluginTagInit.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub type FakePluginTagInit; + #[wasm_bindgen(method, setter = "description")] + fn description_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "fileName")] + fn file_name_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "fullPath")] + fn full_path_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "handlerURI")] + fn handler_uri_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "mimeEntries")] + fn mime_entries_shim(this: &FakePluginTagInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "niceName")] + fn nice_name_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "sandboxScript")] + fn sandbox_script_shim(this: &FakePluginTagInit, val: &str); + #[wasm_bindgen(method, setter = "version")] + fn version_shim(this: &FakePluginTagInit, val: &str); } impl FakePluginTagInit { #[doc = "Construct a new `FakePluginTagInit`."] @@ -26,149 +44,63 @@ impl FakePluginTagInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.description_shim(val); self } #[doc = "Change the `fileName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn file_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fileName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.file_name_shim(val); self } #[doc = "Change the `fullPath` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn full_path(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fullPath"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.full_path_shim(val); self } #[doc = "Change the `handlerURI` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn handler_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handlerURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handler_uri_shim(val); self } #[doc = "Change the `mimeEntries` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn mime_entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeEntries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mime_entries_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `niceName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn nice_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("niceName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.nice_name_shim(val); self } #[doc = "Change the `sandboxScript` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn sandbox_script(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sandboxScript"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sandbox_script_shim(val); self } #[doc = "Change the `version` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FetchEventInit.rs b/crates/web-sys/src/features/gen_FetchEventInit.rs index d199cc656ab..4259035f3d0 100644 --- a/crates/web-sys/src/features/gen_FetchEventInit.rs +++ b/crates/web-sys/src/features/gen_FetchEventInit.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub type FetchEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &FetchEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &FetchEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &FetchEventInit, val: bool); + #[wasm_bindgen(method, setter = "clientId")] + fn client_id_shim(this: &FetchEventInit, val: Option<&str>); + #[wasm_bindgen(method, setter = "isReload")] + fn is_reload_shim(this: &FetchEventInit, val: bool); + #[cfg(feature = "Request")] + #[wasm_bindgen(method, setter = "request")] + fn request_shim(this: &FetchEventInit, val: &Request); } impl FetchEventInit { #[cfg(feature = "Request")] @@ -26,85 +39,35 @@ impl FetchEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `clientId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub fn client_id(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_id_shim(val); self } #[doc = "Change the `isReload` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub fn is_reload(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isReload"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_reload_shim(val); self } #[cfg(feature = "Request")] @@ -112,17 +75,7 @@ impl FetchEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`, `Request`*"] pub fn request(&mut self, val: &Request) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("request"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.request_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs b/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs index 2bbfebba908..3205e8c2b0b 100644 --- a/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs +++ b/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataDone`*"] pub type FetchReadableStreamReadDataDone; + #[wasm_bindgen(method, setter = "done")] + fn done_shim(this: &FetchReadableStreamReadDataDone, val: bool); } impl FetchReadableStreamReadDataDone { #[doc = "Construct a new `FetchReadableStreamReadDataDone`."] @@ -24,13 +26,7 @@ impl FetchReadableStreamReadDataDone { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataDone`*"] 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.done_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileCallback.rs b/crates/web-sys/src/features/gen_FileCallback.rs index 46e03df228d..17beb74983c 100644 --- a/crates/web-sys/src/features/gen_FileCallback.rs +++ b/crates/web-sys/src/features/gen_FileCallback.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileCallback`*"] pub type FileCallback; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &FileCallback, val: &::js_sys::Function); } impl FileCallback { #[doc = "Construct a new `FileCallback`."] @@ -24,17 +26,7 @@ impl FileCallback { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileCallback`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FilePickerAcceptType.rs b/crates/web-sys/src/features/gen_FilePickerAcceptType.rs index cd2e41ab994..196fd6f0a79 100644 --- a/crates/web-sys/src/features/gen_FilePickerAcceptType.rs +++ b/crates/web-sys/src/features/gen_FilePickerAcceptType.rs @@ -14,6 +14,8 @@ 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 type FilePickerAcceptType; + #[wasm_bindgen(method, setter = "description")] + fn description_shim(this: &FilePickerAcceptType, val: &str); } #[cfg(web_sys_unstable_apis)] impl FilePickerAcceptType { @@ -36,17 +38,7 @@ impl FilePickerAcceptType { #[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 description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.description_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FilePickerOptions.rs b/crates/web-sys/src/features/gen_FilePickerOptions.rs index 1548a514129..639ead2b1ea 100644 --- a/crates/web-sys/src/features/gen_FilePickerOptions.rs +++ b/crates/web-sys/src/features/gen_FilePickerOptions.rs @@ -14,6 +14,14 @@ 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 type FilePickerOptions; + #[wasm_bindgen(method, setter = "excludeAcceptAllOption")] + fn exclude_accept_all_option_shim(this: &FilePickerOptions, val: bool); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &FilePickerOptions, val: &str); + #[wasm_bindgen(method, setter = "startIn")] + fn start_in_shim(this: &FilePickerOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "types")] + fn types_shim(this: &FilePickerOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl FilePickerOptions { @@ -36,17 +44,7 @@ impl FilePickerOptions { #[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 exclude_accept_all_option(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("excludeAcceptAllOption"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exclude_accept_all_option_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +55,7 @@ impl FilePickerOptions { #[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 id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +66,7 @@ impl FilePickerOptions { #[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 start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startIn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.start_in_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,13 +77,7 @@ impl FilePickerOptions { #[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 types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("types"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.types_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FilePropertyBag.rs b/crates/web-sys/src/features/gen_FilePropertyBag.rs index f98a68c4fc6..99ecc5bb920 100644 --- a/crates/web-sys/src/features/gen_FilePropertyBag.rs +++ b/crates/web-sys/src/features/gen_FilePropertyBag.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] pub type FilePropertyBag; + #[wasm_bindgen(method, setter = "lastModified")] + fn last_modified_shim(this: &FilePropertyBag, val: f64); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &FilePropertyBag, val: &str); } impl FilePropertyBag { #[doc = "Construct a new `FilePropertyBag`."] @@ -24,30 +28,14 @@ impl FilePropertyBag { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] pub fn last_modified(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastModified"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_modified_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs b/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs index b8a1f135ebd..ae33bfeb6de 100644 --- a/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs +++ b/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] pub type FileSystemCreateWritableOptions; + #[wasm_bindgen(method, setter = "keepExistingData")] + fn keep_existing_data_shim(this: &FileSystemCreateWritableOptions, val: bool); } impl FileSystemCreateWritableOptions { #[doc = "Construct a new `FileSystemCreateWritableOptions`."] @@ -24,17 +26,7 @@ impl FileSystemCreateWritableOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] pub fn keep_existing_data(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keepExistingData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.keep_existing_data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs b/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs index 1909296d864..6cb0cfb560d 100644 --- a/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs +++ b/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntriesCallback`*"] pub type FileSystemEntriesCallback; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &FileSystemEntriesCallback, val: &::js_sys::Function); } impl FileSystemEntriesCallback { #[doc = "Construct a new `FileSystemEntriesCallback`."] @@ -24,17 +26,7 @@ impl FileSystemEntriesCallback { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntriesCallback`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs b/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs index c9162d911bf..4a5988ec2b8 100644 --- a/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs +++ b/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntryCallback`*"] pub type FileSystemEntryCallback; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &FileSystemEntryCallback, val: &::js_sys::Function); } impl FileSystemEntryCallback { #[doc = "Construct a new `FileSystemEntryCallback`."] @@ -24,17 +26,7 @@ impl FileSystemEntryCallback { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntryCallback`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemFlags.rs b/crates/web-sys/src/features/gen_FileSystemFlags.rs index d71c57355fd..bb68735f21e 100644 --- a/crates/web-sys/src/features/gen_FileSystemFlags.rs +++ b/crates/web-sys/src/features/gen_FileSystemFlags.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] pub type FileSystemFlags; + #[wasm_bindgen(method, setter = "create")] + fn create_shim(this: &FileSystemFlags, val: bool); + #[wasm_bindgen(method, setter = "exclusive")] + fn exclusive_shim(this: &FileSystemFlags, val: bool); } impl FileSystemFlags { #[doc = "Construct a new `FileSystemFlags`."] @@ -24,31 +28,14 @@ impl FileSystemFlags { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] pub fn create(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("create"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.create_shim(val); self } #[doc = "Change the `exclusive` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] pub fn exclusive(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("exclusive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exclusive_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs b/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs index e5f3e136a8c..b25b6429426 100644 --- a/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs +++ b/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] pub type FileSystemGetDirectoryOptions; + #[wasm_bindgen(method, setter = "create")] + fn create_shim(this: &FileSystemGetDirectoryOptions, val: bool); } impl FileSystemGetDirectoryOptions { #[doc = "Construct a new `FileSystemGetDirectoryOptions`."] @@ -24,14 +26,7 @@ impl FileSystemGetDirectoryOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] pub fn create(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("create"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.create_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs b/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs index 8cc7a410c09..78004c0a807 100644 --- a/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs +++ b/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] pub type FileSystemGetFileOptions; + #[wasm_bindgen(method, setter = "create")] + fn create_shim(this: &FileSystemGetFileOptions, val: bool); } impl FileSystemGetFileOptions { #[doc = "Construct a new `FileSystemGetFileOptions`."] @@ -24,14 +26,7 @@ impl FileSystemGetFileOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] pub fn create(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("create"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.create_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs b/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs index 00f6d96fe30..042392fed2a 100644 --- a/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs @@ -14,6 +14,9 @@ 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 type FileSystemHandlePermissionDescriptor; + #[cfg(feature = "FileSystemPermissionMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &FileSystemHandlePermissionDescriptor, val: FileSystemPermissionMode); } #[cfg(web_sys_unstable_apis)] impl FileSystemHandlePermissionDescriptor { @@ -37,13 +40,7 @@ impl FileSystemHandlePermissionDescriptor { #[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 mode(&mut self, val: FileSystemPermissionMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs b/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs index b4a2a512c11..b777cfe64f3 100644 --- a/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs @@ -14,6 +14,15 @@ 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 type FileSystemPermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &FileSystemPermissionDescriptor, val: PermissionName); + #[cfg(feature = "FileSystemHandle")] + #[wasm_bindgen(method, setter = "handle")] + fn handle_shim(this: &FileSystemPermissionDescriptor, val: &FileSystemHandle); + #[cfg(feature = "FileSystemPermissionMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &FileSystemPermissionDescriptor, val: FileSystemPermissionMode); } #[cfg(web_sys_unstable_apis)] impl FileSystemPermissionDescriptor { @@ -40,13 +49,7 @@ impl FileSystemPermissionDescriptor { #[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 name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,14 +61,7 @@ impl FileSystemPermissionDescriptor { #[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 handle(&mut self, val: &FileSystemHandle) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("handle"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,13 +73,7 @@ impl FileSystemPermissionDescriptor { #[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 mode(&mut self, val: FileSystemPermissionMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs b/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs index 209b2af448b..c54fb3a3284 100644 --- a/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs +++ b/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] pub type FileSystemReadWriteOptions; + #[wasm_bindgen(method, setter = "at")] + fn at_shim(this: &FileSystemReadWriteOptions, val: f64); } impl FileSystemReadWriteOptions { #[doc = "Construct a new `FileSystemReadWriteOptions`."] @@ -24,13 +26,7 @@ impl FileSystemReadWriteOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] pub fn at(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("at"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.at_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs b/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs index 3f81a31cef0..fbc6e6fdbc7 100644 --- a/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs +++ b/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] pub type FileSystemRemoveOptions; + #[wasm_bindgen(method, setter = "recursive")] + fn recursive_shim(this: &FileSystemRemoveOptions, val: bool); } impl FileSystemRemoveOptions { #[doc = "Construct a new `FileSystemRemoveOptions`."] @@ -24,17 +26,7 @@ impl FileSystemRemoveOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] pub fn recursive(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("recursive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.recursive_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FocusEventInit.rs b/crates/web-sys/src/features/gen_FocusEventInit.rs index 04077403e79..80ec658083c 100644 --- a/crates/web-sys/src/features/gen_FocusEventInit.rs +++ b/crates/web-sys/src/features/gen_FocusEventInit.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] pub type FocusEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &FocusEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &FocusEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &FocusEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &FocusEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &FocusEventInit, val: Option<&Window>); + #[cfg(feature = "EventTarget")] + #[wasm_bindgen(method, setter = "relatedTarget")] + fn related_target_shim(this: &FocusEventInit, val: Option<&EventTarget>); } impl FocusEventInit { #[doc = "Construct a new `FocusEventInit`."] @@ -24,65 +38,28 @@ impl FocusEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,13 +67,7 @@ impl FocusEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[cfg(feature = "EventTarget")] @@ -104,17 +75,7 @@ impl FocusEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `FocusEventInit`*"] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.related_target_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FontFaceDescriptors.rs b/crates/web-sys/src/features/gen_FontFaceDescriptors.rs index d83466e8533..1da0a315c1f 100644 --- a/crates/web-sys/src/features/gen_FontFaceDescriptors.rs +++ b/crates/web-sys/src/features/gen_FontFaceDescriptors.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub type FontFaceDescriptors; + #[wasm_bindgen(method, setter = "display")] + fn display_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "featureSettings")] + fn feature_settings_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "stretch")] + fn stretch_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "style")] + fn style_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "unicodeRange")] + fn unicode_range_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "variant")] + fn variant_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "variationSettings")] + fn variation_settings_shim(this: &FontFaceDescriptors, val: &str); + #[wasm_bindgen(method, setter = "weight")] + fn weight_shim(this: &FontFaceDescriptors, val: &str); } impl FontFaceDescriptors { #[doc = "Construct a new `FontFaceDescriptors`."] @@ -24,129 +40,56 @@ impl FontFaceDescriptors { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn display(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("display"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_shim(val); self } #[doc = "Change the `featureSettings` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn feature_settings(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("featureSettings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.feature_settings_shim(val); self } #[doc = "Change the `stretch` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn stretch(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stretch"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stretch_shim(val); self } #[doc = "Change the `style` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn style(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("style"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.style_shim(val); self } #[doc = "Change the `unicodeRange` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn unicode_range(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unicodeRange"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unicode_range_shim(val); self } #[doc = "Change the `variant` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn variant(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("variant"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.variant_shim(val); self } #[doc = "Change the `variationSettings` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn variation_settings(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("variationSettings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.variation_settings_shim(val); self } #[doc = "Change the `weight` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub fn weight(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("weight"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.weight_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs b/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs index 6046ac078a8..2cab9cdfe02 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] pub type FontFaceSetIteratorResult; + #[wasm_bindgen(method, setter = "done")] + fn done_shim(this: &FontFaceSetIteratorResult, val: bool); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &FontFaceSetIteratorResult, val: &::wasm_bindgen::JsValue); } impl FontFaceSetIteratorResult { #[doc = "Construct a new `FontFaceSetIteratorResult`."] @@ -26,26 +30,14 @@ impl FontFaceSetIteratorResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] 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.done_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] 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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs b/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs index 154e3a30cad..994c5e291e8 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] pub type FontFaceSetLoadEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &FontFaceSetLoadEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &FontFaceSetLoadEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &FontFaceSetLoadEventInit, val: bool); + #[wasm_bindgen(method, setter = "fontfaces")] + fn fontfaces_shim(this: &FontFaceSetLoadEventInit, val: &::wasm_bindgen::JsValue); } impl FontFaceSetLoadEventInit { #[doc = "Construct a new `FontFaceSetLoadEventInit`."] @@ -24,68 +32,28 @@ impl FontFaceSetLoadEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `fontfaces` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] pub fn fontfaces(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fontfaces"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fontfaces_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GainOptions.rs b/crates/web-sys/src/features/gen_GainOptions.rs index fdafdf807e1..a6f06048e20 100644 --- a/crates/web-sys/src/features/gen_GainOptions.rs +++ b/crates/web-sys/src/features/gen_GainOptions.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] pub type GainOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &GainOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &GainOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &GainOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "gain")] + fn gain_shim(this: &GainOptions, val: f32); } impl GainOptions { #[doc = "Construct a new `GainOptions`."] @@ -24,17 +34,7 @@ impl GainOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +42,7 @@ impl GainOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `GainOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,30 +50,14 @@ impl GainOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `GainOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `gain` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] pub fn gain(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gain"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gain_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs b/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs index 6f9b9995c64..039b25d0ea0 100644 --- a/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs +++ b/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] pub type GamepadAxisMoveEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &GamepadAxisMoveEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &GamepadAxisMoveEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &GamepadAxisMoveEventInit, val: bool); + #[cfg(feature = "Gamepad")] + #[wasm_bindgen(method, setter = "gamepad")] + fn gamepad_shim(this: &GamepadAxisMoveEventInit, val: Option<&Gamepad>); + #[wasm_bindgen(method, setter = "axis")] + fn axis_shim(this: &GamepadAxisMoveEventInit, val: u32); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &GamepadAxisMoveEventInit, val: f64); } impl GamepadAxisMoveEventInit { #[doc = "Construct a new `GamepadAxisMoveEventInit`."] @@ -24,51 +37,21 @@ impl GamepadAxisMoveEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Gamepad")] @@ -76,43 +59,21 @@ impl GamepadAxisMoveEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadAxisMoveEventInit`*"] pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gamepad"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gamepad_shim(val); self } #[doc = "Change the `axis` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] pub fn axis(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("axis"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.axis_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] pub fn value(&mut self, val: f64) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs b/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs index 5714242483a..dfe076a66ba 100644 --- a/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs +++ b/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] pub type GamepadButtonEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &GamepadButtonEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &GamepadButtonEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &GamepadButtonEventInit, val: bool); + #[cfg(feature = "Gamepad")] + #[wasm_bindgen(method, setter = "gamepad")] + fn gamepad_shim(this: &GamepadButtonEventInit, val: Option<&Gamepad>); + #[wasm_bindgen(method, setter = "button")] + fn button_shim(this: &GamepadButtonEventInit, val: u32); } impl GamepadButtonEventInit { #[doc = "Construct a new `GamepadButtonEventInit`."] @@ -24,51 +35,21 @@ impl GamepadButtonEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Gamepad")] @@ -76,31 +57,14 @@ impl GamepadButtonEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadButtonEventInit`*"] pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gamepad"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gamepad_shim(val); self } #[doc = "Change the `button` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] pub fn button(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.button_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GamepadEventInit.rs b/crates/web-sys/src/features/gen_GamepadEventInit.rs index 8ffd29284dc..13ee954f335 100644 --- a/crates/web-sys/src/features/gen_GamepadEventInit.rs +++ b/crates/web-sys/src/features/gen_GamepadEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] pub type GamepadEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &GamepadEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &GamepadEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &GamepadEventInit, val: bool); + #[cfg(feature = "Gamepad")] + #[wasm_bindgen(method, setter = "gamepad")] + fn gamepad_shim(this: &GamepadEventInit, val: Option<&Gamepad>); } impl GamepadEventInit { #[doc = "Construct a new `GamepadEventInit`."] @@ -24,51 +33,21 @@ impl GamepadEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Gamepad")] @@ -76,17 +55,7 @@ impl GamepadEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadEventInit`*"] pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gamepad"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gamepad_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GetAnimationsOptions.rs b/crates/web-sys/src/features/gen_GetAnimationsOptions.rs index ec5f36532fc..7f2774c308b 100644 --- a/crates/web-sys/src/features/gen_GetAnimationsOptions.rs +++ b/crates/web-sys/src/features/gen_GetAnimationsOptions.rs @@ -14,6 +14,8 @@ 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 type GetAnimationsOptions; + #[wasm_bindgen(method, setter = "subtree")] + fn subtree_shim(this: &GetAnimationsOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl GetAnimationsOptions { @@ -36,17 +38,7 @@ impl GetAnimationsOptions { #[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 subtree(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subtree"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.subtree_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GetRootNodeOptions.rs b/crates/web-sys/src/features/gen_GetRootNodeOptions.rs index 9539c52a7f7..ba387240e5d 100644 --- a/crates/web-sys/src/features/gen_GetRootNodeOptions.rs +++ b/crates/web-sys/src/features/gen_GetRootNodeOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`*"] pub type GetRootNodeOptions; + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &GetRootNodeOptions, val: bool); } impl GetRootNodeOptions { #[doc = "Construct a new `GetRootNodeOptions`."] @@ -24,17 +26,7 @@ impl GetRootNodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs b/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs index fa5a21d2c7b..c5594b85ad3 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs @@ -14,6 +14,13 @@ 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 type GpuBindGroupDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuBindGroupDescriptor, val: &str); + #[wasm_bindgen(method, setter = "entries")] + fn entries_shim(this: &GpuBindGroupDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuBindGroupLayout")] + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &GpuBindGroupDescriptor, val: &GpuBindGroupLayout); } #[cfg(web_sys_unstable_apis)] impl GpuBindGroupDescriptor { @@ -39,13 +46,7 @@ impl GpuBindGroupDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,17 +57,7 @@ impl GpuBindGroupDescriptor { #[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 entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entries_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,14 +69,7 @@ impl GpuBindGroupDescriptor { #[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 layout(&mut self, val: &GpuBindGroupLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs b/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs index e4dce4d2762..e41ab563eba 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs @@ -14,6 +14,10 @@ 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 type GpuBindGroupEntry; + #[wasm_bindgen(method, setter = "binding")] + fn binding_shim(this: &GpuBindGroupEntry, val: u32); + #[wasm_bindgen(method, setter = "resource")] + fn resource_shim(this: &GpuBindGroupEntry, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuBindGroupEntry { @@ -38,17 +42,7 @@ impl GpuBindGroupEntry { #[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 binding(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.binding_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +53,7 @@ impl GpuBindGroupEntry { #[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 resource(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.resource_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs index 5faf64dc6d2..2ca1218a16e 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs @@ -14,6 +14,10 @@ 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 type GpuBindGroupLayoutDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuBindGroupLayoutDescriptor, val: &str); + #[wasm_bindgen(method, setter = "entries")] + fn entries_shim(this: &GpuBindGroupLayoutDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuBindGroupLayoutDescriptor { @@ -37,13 +41,7 @@ impl GpuBindGroupLayoutDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +52,7 @@ impl GpuBindGroupLayoutDescriptor { #[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 entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entries_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs index b072d01e18d..87e1e46d5c9 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs @@ -14,6 +14,25 @@ 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 type GpuBindGroupLayoutEntry; + #[wasm_bindgen(method, setter = "binding")] + fn binding_shim(this: &GpuBindGroupLayoutEntry, val: u32); + #[cfg(feature = "GpuBufferBindingLayout")] + #[wasm_bindgen(method, setter = "buffer")] + fn buffer_shim(this: &GpuBindGroupLayoutEntry, val: &GpuBufferBindingLayout); + #[cfg(feature = "GpuExternalTextureBindingLayout")] + #[wasm_bindgen(method, setter = "externalTexture")] + fn external_texture_shim(this: &GpuBindGroupLayoutEntry, val: &GpuExternalTextureBindingLayout); + #[cfg(feature = "GpuSamplerBindingLayout")] + #[wasm_bindgen(method, setter = "sampler")] + fn sampler_shim(this: &GpuBindGroupLayoutEntry, val: &GpuSamplerBindingLayout); + #[cfg(feature = "GpuStorageTextureBindingLayout")] + #[wasm_bindgen(method, setter = "storageTexture")] + fn storage_texture_shim(this: &GpuBindGroupLayoutEntry, val: &GpuStorageTextureBindingLayout); + #[cfg(feature = "GpuTextureBindingLayout")] + #[wasm_bindgen(method, setter = "texture")] + fn texture_shim(this: &GpuBindGroupLayoutEntry, val: &GpuTextureBindingLayout); + #[wasm_bindgen(method, setter = "visibility")] + fn visibility_shim(this: &GpuBindGroupLayoutEntry, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuBindGroupLayoutEntry { @@ -38,17 +57,7 @@ impl GpuBindGroupLayoutEntry { #[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 binding(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.binding_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,14 +69,7 @@ impl GpuBindGroupLayoutEntry { #[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 buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffer_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +81,7 @@ impl GpuBindGroupLayoutEntry { #[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 external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("externalTexture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.external_texture_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -101,17 +93,7 @@ impl GpuBindGroupLayoutEntry { #[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 sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampler"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sampler_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -123,17 +105,7 @@ impl GpuBindGroupLayoutEntry { #[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 storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storageTexture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.storage_texture_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -145,17 +117,7 @@ impl GpuBindGroupLayoutEntry { #[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 texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.texture_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -166,17 +128,7 @@ impl GpuBindGroupLayoutEntry { #[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 visibility(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibility"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.visibility_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBlendComponent.rs b/crates/web-sys/src/features/gen_GpuBlendComponent.rs index 6449482751d..03ed104e2f1 100644 --- a/crates/web-sys/src/features/gen_GpuBlendComponent.rs +++ b/crates/web-sys/src/features/gen_GpuBlendComponent.rs @@ -14,6 +14,15 @@ 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 type GpuBlendComponent; + #[cfg(feature = "GpuBlendFactor")] + #[wasm_bindgen(method, setter = "dstFactor")] + fn dst_factor_shim(this: &GpuBlendComponent, val: GpuBlendFactor); + #[cfg(feature = "GpuBlendOperation")] + #[wasm_bindgen(method, setter = "operation")] + fn operation_shim(this: &GpuBlendComponent, val: GpuBlendOperation); + #[cfg(feature = "GpuBlendFactor")] + #[wasm_bindgen(method, setter = "srcFactor")] + fn src_factor_shim(this: &GpuBlendComponent, val: GpuBlendFactor); } #[cfg(web_sys_unstable_apis)] impl GpuBlendComponent { @@ -37,17 +46,7 @@ impl GpuBlendComponent { #[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 dst_factor(&mut self, val: GpuBlendFactor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dstFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dst_factor_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +58,7 @@ impl GpuBlendComponent { #[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 operation(&mut self, val: GpuBlendOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("operation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.operation_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +70,7 @@ impl GpuBlendComponent { #[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 src_factor(&mut self, val: GpuBlendFactor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("srcFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.src_factor_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBlendState.rs b/crates/web-sys/src/features/gen_GpuBlendState.rs index 70b2833a709..80b609acd5d 100644 --- a/crates/web-sys/src/features/gen_GpuBlendState.rs +++ b/crates/web-sys/src/features/gen_GpuBlendState.rs @@ -14,6 +14,12 @@ 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 type GpuBlendState; + #[cfg(feature = "GpuBlendComponent")] + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &GpuBlendState, val: &GpuBlendComponent); + #[cfg(feature = "GpuBlendComponent")] + #[wasm_bindgen(method, setter = "color")] + fn color_shim(this: &GpuBlendState, val: &GpuBlendComponent); } #[cfg(web_sys_unstable_apis)] impl GpuBlendState { @@ -40,13 +46,7 @@ impl GpuBlendState { #[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 alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,13 +58,7 @@ impl GpuBlendState { #[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 color(&mut self, val: &GpuBlendComponent) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("color"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBufferBinding.rs b/crates/web-sys/src/features/gen_GpuBufferBinding.rs index 9181923a5f0..170abfdb707 100644 --- a/crates/web-sys/src/features/gen_GpuBufferBinding.rs +++ b/crates/web-sys/src/features/gen_GpuBufferBinding.rs @@ -14,6 +14,13 @@ 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 type GpuBufferBinding; + #[cfg(feature = "GpuBuffer")] + #[wasm_bindgen(method, setter = "buffer")] + fn buffer_shim(this: &GpuBufferBinding, val: &GpuBuffer); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &GpuBufferBinding, val: f64); + #[wasm_bindgen(method, setter = "size")] + fn size_shim(this: &GpuBufferBinding, val: f64); } #[cfg(web_sys_unstable_apis)] impl GpuBufferBinding { @@ -39,14 +46,7 @@ impl GpuBufferBinding { #[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 buffer(&mut self, val: &GpuBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffer_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,14 +57,7 @@ impl GpuBufferBinding { #[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 offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,13 +68,7 @@ impl GpuBufferBinding { #[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 size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.size_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs b/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs index 3ce28b46bc3..b78b7a4c753 100644 --- a/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs @@ -14,6 +14,13 @@ 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 type GpuBufferBindingLayout; + #[wasm_bindgen(method, setter = "hasDynamicOffset")] + fn has_dynamic_offset_shim(this: &GpuBufferBindingLayout, val: bool); + #[wasm_bindgen(method, setter = "minBindingSize")] + fn min_binding_size_shim(this: &GpuBufferBindingLayout, val: f64); + #[cfg(feature = "GpuBufferBindingType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &GpuBufferBindingLayout, val: GpuBufferBindingType); } #[cfg(web_sys_unstable_apis)] impl GpuBufferBindingLayout { @@ -36,17 +43,7 @@ impl GpuBufferBindingLayout { #[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 has_dynamic_offset(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasDynamicOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.has_dynamic_offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +54,7 @@ impl GpuBufferBindingLayout { #[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 min_binding_size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minBindingSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_binding_size_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,13 +66,7 @@ impl GpuBufferBindingLayout { #[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 type_(&mut self, val: GpuBufferBindingType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs b/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs index adb1ae3160c..432a97950b9 100644 --- a/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs @@ -14,6 +14,14 @@ 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 type GpuBufferDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuBufferDescriptor, val: &str); + #[wasm_bindgen(method, setter = "mappedAtCreation")] + fn mapped_at_creation_shim(this: &GpuBufferDescriptor, val: bool); + #[wasm_bindgen(method, setter = "size")] + fn size_shim(this: &GpuBufferDescriptor, val: f64); + #[wasm_bindgen(method, setter = "usage")] + fn usage_shim(this: &GpuBufferDescriptor, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuBufferDescriptor { @@ -38,13 +46,7 @@ impl GpuBufferDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,17 +57,7 @@ impl GpuBufferDescriptor { #[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 mapped_at_creation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mappedAtCreation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mapped_at_creation_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,13 +68,7 @@ impl GpuBufferDescriptor { #[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 size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.size_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -93,13 +79,7 @@ impl GpuBufferDescriptor { #[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 usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs b/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs index 84c5ca43738..151e60d979b 100644 --- a/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs +++ b/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs @@ -14,6 +14,19 @@ 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 type GpuCanvasConfiguration; + #[cfg(feature = "GpuCanvasAlphaMode")] + #[wasm_bindgen(method, setter = "alphaMode")] + fn alpha_mode_shim(this: &GpuCanvasConfiguration, val: GpuCanvasAlphaMode); + #[cfg(feature = "GpuDevice")] + #[wasm_bindgen(method, setter = "device")] + fn device_shim(this: &GpuCanvasConfiguration, val: &GpuDevice); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuCanvasConfiguration, val: GpuTextureFormat); + #[wasm_bindgen(method, setter = "usage")] + fn usage_shim(this: &GpuCanvasConfiguration, val: u32); + #[wasm_bindgen(method, setter = "viewFormats")] + fn view_formats_shim(this: &GpuCanvasConfiguration, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuCanvasConfiguration { @@ -40,17 +53,7 @@ impl GpuCanvasConfiguration { #[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 alpha_mode(&mut self, val: GpuCanvasAlphaMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -62,14 +65,7 @@ impl GpuCanvasConfiguration { #[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 device(&mut self, val: &GpuDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,14 +77,7 @@ impl GpuCanvasConfiguration { #[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 format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,13 +88,7 @@ impl GpuCanvasConfiguration { #[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 usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -116,17 +99,7 @@ impl GpuCanvasConfiguration { #[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 view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_formats_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuColorDict.rs b/crates/web-sys/src/features/gen_GpuColorDict.rs index 51d4be5888d..43041c4c8d6 100644 --- a/crates/web-sys/src/features/gen_GpuColorDict.rs +++ b/crates/web-sys/src/features/gen_GpuColorDict.rs @@ -14,6 +14,14 @@ 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 type GpuColorDict; + #[wasm_bindgen(method, setter = "a")] + fn a_shim(this: &GpuColorDict, val: f64); + #[wasm_bindgen(method, setter = "b")] + fn b_shim(this: &GpuColorDict, val: f64); + #[wasm_bindgen(method, setter = "g")] + fn g_shim(this: &GpuColorDict, val: f64); + #[wasm_bindgen(method, setter = "r")] + fn r_shim(this: &GpuColorDict, val: f64); } #[cfg(web_sys_unstable_apis)] impl GpuColorDict { @@ -40,13 +48,7 @@ impl GpuColorDict { #[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 a(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("a"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.a_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +59,7 @@ impl GpuColorDict { #[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 b(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("b"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.b_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,13 +70,7 @@ impl GpuColorDict { #[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 g(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("g"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.g_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -91,13 +81,7 @@ impl GpuColorDict { #[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 r(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("r"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.r_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuColorTargetState.rs b/crates/web-sys/src/features/gen_GpuColorTargetState.rs index d239a268274..252c6c88da2 100644 --- a/crates/web-sys/src/features/gen_GpuColorTargetState.rs +++ b/crates/web-sys/src/features/gen_GpuColorTargetState.rs @@ -14,6 +14,14 @@ 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 type GpuColorTargetState; + #[cfg(feature = "GpuBlendState")] + #[wasm_bindgen(method, setter = "blend")] + fn blend_shim(this: &GpuColorTargetState, val: &GpuBlendState); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuColorTargetState, val: GpuTextureFormat); + #[wasm_bindgen(method, setter = "writeMask")] + fn write_mask_shim(this: &GpuColorTargetState, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuColorTargetState { @@ -39,13 +47,7 @@ impl GpuColorTargetState { #[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 blend(&mut self, val: &GpuBlendState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("blend"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.blend_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,14 +59,7 @@ impl GpuColorTargetState { #[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 format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +70,7 @@ impl GpuColorTargetState { #[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_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writeMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.write_mask_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs b/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs index 34036b2c850..556718c1c69 100644 --- a/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs @@ -14,6 +14,8 @@ 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 type GpuCommandBufferDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuCommandBufferDescriptor, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuCommandBufferDescriptor { @@ -36,13 +38,7 @@ impl GpuCommandBufferDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs b/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs index 08a08d44f13..5e6cb5ae4d6 100644 --- a/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs @@ -14,6 +14,8 @@ 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 type GpuCommandEncoderDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuCommandEncoderDescriptor, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuCommandEncoderDescriptor { @@ -36,13 +38,7 @@ impl GpuCommandEncoderDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs index 18b414291e7..ba493a46692 100644 --- a/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs @@ -14,6 +14,11 @@ 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 type GpuComputePassDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuComputePassDescriptor, val: &str); + #[cfg(feature = "GpuComputePassTimestampWrites")] + #[wasm_bindgen(method, setter = "timestampWrites")] + fn timestamp_writes_shim(this: &GpuComputePassDescriptor, val: &GpuComputePassTimestampWrites); } #[cfg(web_sys_unstable_apis)] impl GpuComputePassDescriptor { @@ -36,13 +41,7 @@ impl GpuComputePassDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +53,7 @@ impl GpuComputePassDescriptor { #[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 timestamp_writes(&mut self, val: &GpuComputePassTimestampWrites) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestampWrites"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_writes_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs b/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs index 52a43c7e0a8..fec406f183f 100644 --- a/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs +++ b/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs @@ -14,6 +14,13 @@ 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 type GpuComputePassTimestampWrites; + #[wasm_bindgen(method, setter = "beginningOfPassWriteIndex")] + fn beginning_of_pass_write_index_shim(this: &GpuComputePassTimestampWrites, val: u32); + #[wasm_bindgen(method, setter = "endOfPassWriteIndex")] + fn end_of_pass_write_index_shim(this: &GpuComputePassTimestampWrites, val: u32); + #[cfg(feature = "GpuQuerySet")] + #[wasm_bindgen(method, setter = "querySet")] + fn query_set_shim(this: &GpuComputePassTimestampWrites, val: &GpuQuerySet); } #[cfg(web_sys_unstable_apis)] impl GpuComputePassTimestampWrites { @@ -38,17 +45,7 @@ impl GpuComputePassTimestampWrites { #[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 beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("beginningOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.beginning_of_pass_write_index_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +56,7 @@ impl GpuComputePassTimestampWrites { #[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 end_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_of_pass_write_index_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +68,7 @@ impl GpuComputePassTimestampWrites { #[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 query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("querySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.query_set_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs index 22a28382229..ad49e55c478 100644 --- a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs @@ -14,6 +14,13 @@ 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 type GpuComputePipelineDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuComputePipelineDescriptor, val: &str); + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &GpuComputePipelineDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuProgrammableStage")] + #[wasm_bindgen(method, setter = "compute")] + fn compute_shim(this: &GpuComputePipelineDescriptor, val: &GpuProgrammableStage); } #[cfg(web_sys_unstable_apis)] impl GpuComputePipelineDescriptor { @@ -39,13 +46,7 @@ impl GpuComputePipelineDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,14 +57,7 @@ impl GpuComputePipelineDescriptor { #[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 layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +69,7 @@ impl GpuComputePipelineDescriptor { #[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 compute(&mut self, val: &GpuProgrammableStage) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.compute_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuDepthStencilState.rs b/crates/web-sys/src/features/gen_GpuDepthStencilState.rs index 8869e1ce387..f991cd4c9b4 100644 --- a/crates/web-sys/src/features/gen_GpuDepthStencilState.rs +++ b/crates/web-sys/src/features/gen_GpuDepthStencilState.rs @@ -14,6 +14,30 @@ 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 type GpuDepthStencilState; + #[wasm_bindgen(method, setter = "depthBias")] + fn depth_bias_shim(this: &GpuDepthStencilState, val: i32); + #[wasm_bindgen(method, setter = "depthBiasClamp")] + fn depth_bias_clamp_shim(this: &GpuDepthStencilState, val: f32); + #[wasm_bindgen(method, setter = "depthBiasSlopeScale")] + fn depth_bias_slope_scale_shim(this: &GpuDepthStencilState, val: f32); + #[cfg(feature = "GpuCompareFunction")] + #[wasm_bindgen(method, setter = "depthCompare")] + fn depth_compare_shim(this: &GpuDepthStencilState, val: GpuCompareFunction); + #[wasm_bindgen(method, setter = "depthWriteEnabled")] + fn depth_write_enabled_shim(this: &GpuDepthStencilState, val: bool); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuDepthStencilState, val: GpuTextureFormat); + #[cfg(feature = "GpuStencilFaceState")] + #[wasm_bindgen(method, setter = "stencilBack")] + fn stencil_back_shim(this: &GpuDepthStencilState, val: &GpuStencilFaceState); + #[cfg(feature = "GpuStencilFaceState")] + #[wasm_bindgen(method, setter = "stencilFront")] + fn stencil_front_shim(this: &GpuDepthStencilState, val: &GpuStencilFaceState); + #[wasm_bindgen(method, setter = "stencilReadMask")] + fn stencil_read_mask_shim(this: &GpuDepthStencilState, val: u32); + #[wasm_bindgen(method, setter = "stencilWriteMask")] + fn stencil_write_mask_shim(this: &GpuDepthStencilState, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuDepthStencilState { @@ -38,17 +62,7 @@ impl GpuDepthStencilState { #[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 depth_bias(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_bias_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +73,7 @@ impl GpuDepthStencilState { #[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 depth_bias_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_bias_clamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +84,7 @@ impl GpuDepthStencilState { #[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 depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasSlopeScale"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_bias_slope_scale_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,17 +96,7 @@ impl GpuDepthStencilState { #[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 depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthCompare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_compare_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -123,17 +107,7 @@ impl GpuDepthStencilState { #[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 depth_write_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthWriteEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_write_enabled_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -145,14 +119,7 @@ impl GpuDepthStencilState { #[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 format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -164,17 +131,7 @@ impl GpuDepthStencilState { #[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 stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilBack"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_back_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -186,17 +143,7 @@ impl GpuDepthStencilState { #[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 stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilFront"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_front_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -207,17 +154,7 @@ impl GpuDepthStencilState { #[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 stencil_read_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_read_mask_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -228,17 +165,7 @@ impl GpuDepthStencilState { #[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 stencil_write_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilWriteMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_write_mask_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs index e414b2d649a..4507817ca89 100644 --- a/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs @@ -14,6 +14,13 @@ 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 type GpuDeviceDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuDeviceDescriptor, val: &str); + #[cfg(feature = "GpuQueueDescriptor")] + #[wasm_bindgen(method, setter = "defaultQueue")] + fn default_queue_shim(this: &GpuDeviceDescriptor, val: &GpuQueueDescriptor); + #[wasm_bindgen(method, setter = "requiredFeatures")] + fn required_features_shim(this: &GpuDeviceDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuDeviceDescriptor { @@ -36,13 +43,7 @@ impl GpuDeviceDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +55,7 @@ impl GpuDeviceDescriptor { #[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 default_queue(&mut self, val: &GpuQueueDescriptor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("defaultQueue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.default_queue_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +66,7 @@ impl GpuDeviceDescriptor { #[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 required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requiredFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.required_features_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs index b99cac13faa..b0c9f2338d1 100644 --- a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs +++ b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs @@ -14,6 +14,12 @@ 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 type GpuExtent3dDict; + #[wasm_bindgen(method, setter = "depthOrArrayLayers")] + fn depth_or_array_layers_shim(this: &GpuExtent3dDict, val: u32); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &GpuExtent3dDict, val: u32); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &GpuExtent3dDict, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuExtent3dDict { @@ -37,17 +43,7 @@ impl GpuExtent3dDict { #[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 depth_or_array_layers(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthOrArrayLayers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_or_array_layers_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,14 +54,7 @@ impl GpuExtent3dDict { #[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 height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,13 +65,7 @@ impl GpuExtent3dDict { #[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 width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs b/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs index 34ffa8f9195..13c397f5f3f 100644 --- a/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs @@ -14,6 +14,10 @@ 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 type GpuExternalTextureDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuExternalTextureDescriptor, val: &str); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &GpuExternalTextureDescriptor, val: &::js_sys::Object); } #[cfg(web_sys_unstable_apis)] impl GpuExternalTextureDescriptor { @@ -37,13 +41,7 @@ impl GpuExternalTextureDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,14 +52,7 @@ impl GpuExternalTextureDescriptor { #[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 source(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuFragmentState.rs b/crates/web-sys/src/features/gen_GpuFragmentState.rs index 4b2fe1e5080..e39fe9e57cb 100644 --- a/crates/web-sys/src/features/gen_GpuFragmentState.rs +++ b/crates/web-sys/src/features/gen_GpuFragmentState.rs @@ -14,6 +14,13 @@ 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 type GpuFragmentState; + #[wasm_bindgen(method, setter = "entryPoint")] + fn entry_point_shim(this: &GpuFragmentState, val: &str); + #[cfg(feature = "GpuShaderModule")] + #[wasm_bindgen(method, setter = "module")] + fn module_shim(this: &GpuFragmentState, val: &GpuShaderModule); + #[wasm_bindgen(method, setter = "targets")] + fn targets_shim(this: &GpuFragmentState, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuFragmentState { @@ -39,17 +46,7 @@ impl GpuFragmentState { #[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 entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_point_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -61,14 +58,7 @@ impl GpuFragmentState { #[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 module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.module_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +69,7 @@ impl GpuFragmentState { #[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 targets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.targets_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs b/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs index 20ca5f341fe..fdfcc69a438 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs @@ -14,6 +14,15 @@ 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 type GpuImageCopyBuffer; + #[wasm_bindgen(method, setter = "bytesPerRow")] + fn bytes_per_row_shim(this: &GpuImageCopyBuffer, val: u32); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &GpuImageCopyBuffer, val: f64); + #[wasm_bindgen(method, setter = "rowsPerImage")] + fn rows_per_image_shim(this: &GpuImageCopyBuffer, val: u32); + #[cfg(feature = "GpuBuffer")] + #[wasm_bindgen(method, setter = "buffer")] + fn buffer_shim(this: &GpuImageCopyBuffer, val: &GpuBuffer); } #[cfg(web_sys_unstable_apis)] impl GpuImageCopyBuffer { @@ -38,17 +47,7 @@ impl GpuImageCopyBuffer { #[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 bytes_per_row(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesPerRow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_per_row_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,14 +58,7 @@ impl GpuImageCopyBuffer { #[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 offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +69,7 @@ impl GpuImageCopyBuffer { #[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 rows_per_image(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rowsPerImage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rows_per_image_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,14 +81,7 @@ impl GpuImageCopyBuffer { #[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 buffer(&mut self, val: &GpuBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffer_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs b/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs index acd0d531718..54c22ac9306 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs @@ -14,6 +14,12 @@ 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 type GpuImageCopyExternalImage; + #[wasm_bindgen(method, setter = "flipY")] + fn flip_y_shim(this: &GpuImageCopyExternalImage, val: bool); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &GpuImageCopyExternalImage, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &GpuImageCopyExternalImage, val: &::js_sys::Object); } #[cfg(web_sys_unstable_apis)] impl GpuImageCopyExternalImage { @@ -37,13 +43,7 @@ impl GpuImageCopyExternalImage { #[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 flip_y(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flipY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.flip_y_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,14 +54,7 @@ impl GpuImageCopyExternalImage { #[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 origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -72,14 +65,7 @@ impl GpuImageCopyExternalImage { #[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 source(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs b/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs index 4b727effa12..c461d41a126 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs @@ -14,6 +14,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 type GpuImageCopyTexture; + #[cfg(feature = "GpuTextureAspect")] + #[wasm_bindgen(method, setter = "aspect")] + fn aspect_shim(this: &GpuImageCopyTexture, val: GpuTextureAspect); + #[wasm_bindgen(method, setter = "mipLevel")] + fn mip_level_shim(this: &GpuImageCopyTexture, val: u32); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &GpuImageCopyTexture, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuTexture")] + #[wasm_bindgen(method, setter = "texture")] + fn texture_shim(this: &GpuImageCopyTexture, val: &GpuTexture); } #[cfg(web_sys_unstable_apis)] impl GpuImageCopyTexture { @@ -39,14 +49,7 @@ impl GpuImageCopyTexture { #[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 aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.aspect_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +60,7 @@ impl GpuImageCopyTexture { #[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 mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mip_level_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,14 +71,7 @@ impl GpuImageCopyTexture { #[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 origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -97,17 +83,7 @@ impl GpuImageCopyTexture { #[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 texture(&mut self, val: &GpuTexture) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.texture_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs b/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs index 64d38a7c270..554f63396d4 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs +++ b/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs @@ -14,6 +14,18 @@ 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 type GpuImageCopyTextureTagged; + #[cfg(feature = "GpuTextureAspect")] + #[wasm_bindgen(method, setter = "aspect")] + fn aspect_shim(this: &GpuImageCopyTextureTagged, val: GpuTextureAspect); + #[wasm_bindgen(method, setter = "mipLevel")] + fn mip_level_shim(this: &GpuImageCopyTextureTagged, val: u32); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &GpuImageCopyTextureTagged, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuTexture")] + #[wasm_bindgen(method, setter = "texture")] + fn texture_shim(this: &GpuImageCopyTextureTagged, val: &GpuTexture); + #[wasm_bindgen(method, setter = "premultipliedAlpha")] + fn premultiplied_alpha_shim(this: &GpuImageCopyTextureTagged, val: bool); } #[cfg(web_sys_unstable_apis)] impl GpuImageCopyTextureTagged { @@ -39,14 +51,7 @@ impl GpuImageCopyTextureTagged { #[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 aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.aspect_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +62,7 @@ impl GpuImageCopyTextureTagged { #[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 mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mip_level_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,14 +73,7 @@ impl GpuImageCopyTextureTagged { #[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 origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -97,17 +85,7 @@ impl GpuImageCopyTextureTagged { #[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 texture(&mut self, val: &GpuTexture) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.texture_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -118,17 +96,7 @@ impl GpuImageCopyTextureTagged { #[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 premultiplied_alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultipliedAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.premultiplied_alpha_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuImageDataLayout.rs b/crates/web-sys/src/features/gen_GpuImageDataLayout.rs index 25895ed4ea3..cb267577615 100644 --- a/crates/web-sys/src/features/gen_GpuImageDataLayout.rs +++ b/crates/web-sys/src/features/gen_GpuImageDataLayout.rs @@ -14,6 +14,12 @@ 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 type GpuImageDataLayout; + #[wasm_bindgen(method, setter = "bytesPerRow")] + fn bytes_per_row_shim(this: &GpuImageDataLayout, val: u32); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &GpuImageDataLayout, val: f64); + #[wasm_bindgen(method, setter = "rowsPerImage")] + fn rows_per_image_shim(this: &GpuImageDataLayout, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuImageDataLayout { @@ -36,17 +42,7 @@ impl GpuImageDataLayout { #[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 bytes_per_row(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesPerRow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_per_row_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,14 +53,7 @@ impl GpuImageDataLayout { #[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 offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +64,7 @@ impl GpuImageDataLayout { #[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 rows_per_image(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rowsPerImage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rows_per_image_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuMultisampleState.rs b/crates/web-sys/src/features/gen_GpuMultisampleState.rs index e9bf783dbfb..af9b5e2e8ec 100644 --- a/crates/web-sys/src/features/gen_GpuMultisampleState.rs +++ b/crates/web-sys/src/features/gen_GpuMultisampleState.rs @@ -14,6 +14,12 @@ 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 type GpuMultisampleState; + #[wasm_bindgen(method, setter = "alphaToCoverageEnabled")] + fn alpha_to_coverage_enabled_shim(this: &GpuMultisampleState, val: bool); + #[wasm_bindgen(method, setter = "count")] + fn count_shim(this: &GpuMultisampleState, val: u32); + #[wasm_bindgen(method, setter = "mask")] + fn mask_shim(this: &GpuMultisampleState, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuMultisampleState { @@ -36,17 +42,7 @@ impl GpuMultisampleState { #[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 alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaToCoverageEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_to_coverage_enabled_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +53,7 @@ impl GpuMultisampleState { #[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 count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,13 +64,7 @@ impl GpuMultisampleState { #[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 mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mask_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs b/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs index 5757b09e917..147e49b806a 100644 --- a/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs +++ b/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs @@ -14,6 +14,8 @@ 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 type GpuObjectDescriptorBase; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuObjectDescriptorBase, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuObjectDescriptorBase { @@ -36,13 +38,7 @@ impl GpuObjectDescriptorBase { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs b/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs index 17076b5e186..da5d620d658 100644 --- a/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs +++ b/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs @@ -14,6 +14,10 @@ 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 type GpuOrigin2dDict; + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &GpuOrigin2dDict, val: u32); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &GpuOrigin2dDict, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuOrigin2dDict { @@ -36,13 +40,7 @@ impl GpuOrigin2dDict { #[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 x(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,13 +51,7 @@ impl GpuOrigin2dDict { #[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 y(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs b/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs index 046991140b8..ddca14f3aae 100644 --- a/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs +++ b/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs @@ -14,6 +14,12 @@ 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 type GpuOrigin3dDict; + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &GpuOrigin3dDict, val: u32); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &GpuOrigin3dDict, val: u32); + #[wasm_bindgen(method, setter = "z")] + fn z_shim(this: &GpuOrigin3dDict, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuOrigin3dDict { @@ -36,13 +42,7 @@ impl GpuOrigin3dDict { #[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 x(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,13 +53,7 @@ impl GpuOrigin3dDict { #[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 y(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -70,13 +64,7 @@ impl GpuOrigin3dDict { #[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 z(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.z_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs b/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs index 6b09d65430f..8f94167a0c2 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs +++ b/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs @@ -14,6 +14,10 @@ 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 type GpuPipelineDescriptorBase; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuPipelineDescriptorBase, val: &str); + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &GpuPipelineDescriptorBase, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuPipelineDescriptorBase { @@ -37,13 +41,7 @@ impl GpuPipelineDescriptorBase { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,14 +52,7 @@ impl GpuPipelineDescriptorBase { #[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 layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs b/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs index d56b6c4b4bf..4153f498d14 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs +++ b/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs @@ -14,6 +14,9 @@ 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 type GpuPipelineErrorInit; + #[cfg(feature = "GpuPipelineErrorReason")] + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &GpuPipelineErrorInit, val: GpuPipelineErrorReason); } #[cfg(web_sys_unstable_apis)] impl GpuPipelineErrorInit { @@ -39,14 +42,7 @@ impl GpuPipelineErrorInit { #[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 reason(&mut self, val: GpuPipelineErrorReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs index 40fd2d3e603..a1113b81f2f 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs @@ -14,6 +14,10 @@ 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 type GpuPipelineLayoutDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuPipelineLayoutDescriptor, val: &str); + #[wasm_bindgen(method, setter = "bindGroupLayouts")] + fn bind_group_layouts_shim(this: &GpuPipelineLayoutDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuPipelineLayoutDescriptor { @@ -37,13 +41,7 @@ impl GpuPipelineLayoutDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +52,7 @@ impl GpuPipelineLayoutDescriptor { #[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 bind_group_layouts(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bindGroupLayouts"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bind_group_layouts_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPrimitiveState.rs b/crates/web-sys/src/features/gen_GpuPrimitiveState.rs index a7e63b3cc37..1c2c627c22a 100644 --- a/crates/web-sys/src/features/gen_GpuPrimitiveState.rs +++ b/crates/web-sys/src/features/gen_GpuPrimitiveState.rs @@ -14,6 +14,20 @@ 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 type GpuPrimitiveState; + #[cfg(feature = "GpuCullMode")] + #[wasm_bindgen(method, setter = "cullMode")] + fn cull_mode_shim(this: &GpuPrimitiveState, val: GpuCullMode); + #[cfg(feature = "GpuFrontFace")] + #[wasm_bindgen(method, setter = "frontFace")] + fn front_face_shim(this: &GpuPrimitiveState, val: GpuFrontFace); + #[cfg(feature = "GpuIndexFormat")] + #[wasm_bindgen(method, setter = "stripIndexFormat")] + fn strip_index_format_shim(this: &GpuPrimitiveState, val: GpuIndexFormat); + #[cfg(feature = "GpuPrimitiveTopology")] + #[wasm_bindgen(method, setter = "topology")] + fn topology_shim(this: &GpuPrimitiveState, val: GpuPrimitiveTopology); + #[wasm_bindgen(method, setter = "unclippedDepth")] + fn unclipped_depth_shim(this: &GpuPrimitiveState, val: bool); } #[cfg(web_sys_unstable_apis)] impl GpuPrimitiveState { @@ -37,17 +51,7 @@ impl GpuPrimitiveState { #[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 cull_mode(&mut self, val: GpuCullMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cullMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cull_mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +63,7 @@ impl GpuPrimitiveState { #[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 front_face(&mut self, val: GpuFrontFace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frontFace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.front_face_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +75,7 @@ impl GpuPrimitiveState { #[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 strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stripIndexFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.strip_index_format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -103,17 +87,7 @@ impl GpuPrimitiveState { #[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 topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("topology"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.topology_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -124,17 +98,7 @@ impl GpuPrimitiveState { #[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 unclipped_depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unclippedDepth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unclipped_depth_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuProgrammableStage.rs b/crates/web-sys/src/features/gen_GpuProgrammableStage.rs index 7934d6afdc1..2cce8beb098 100644 --- a/crates/web-sys/src/features/gen_GpuProgrammableStage.rs +++ b/crates/web-sys/src/features/gen_GpuProgrammableStage.rs @@ -14,6 +14,11 @@ 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 type GpuProgrammableStage; + #[wasm_bindgen(method, setter = "entryPoint")] + fn entry_point_shim(this: &GpuProgrammableStage, val: &str); + #[cfg(feature = "GpuShaderModule")] + #[wasm_bindgen(method, setter = "module")] + fn module_shim(this: &GpuProgrammableStage, val: &GpuShaderModule); } #[cfg(web_sys_unstable_apis)] impl GpuProgrammableStage { @@ -38,17 +43,7 @@ impl GpuProgrammableStage { #[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 entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_point_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,14 +55,7 @@ impl GpuProgrammableStage { #[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 module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.module_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs b/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs index 7dcddb12d6e..5fab281c1c3 100644 --- a/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs @@ -14,6 +14,13 @@ 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 type GpuQuerySetDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuQuerySetDescriptor, val: &str); + #[wasm_bindgen(method, setter = "count")] + fn count_shim(this: &GpuQuerySetDescriptor, val: u32); + #[cfg(feature = "GpuQueryType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &GpuQuerySetDescriptor, val: GpuQueryType); } #[cfg(web_sys_unstable_apis)] impl GpuQuerySetDescriptor { @@ -39,13 +46,7 @@ impl GpuQuerySetDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,13 +57,7 @@ impl GpuQuerySetDescriptor { #[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 count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,13 +69,7 @@ impl GpuQuerySetDescriptor { #[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 type_(&mut self, val: GpuQueryType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuQueueDescriptor.rs b/crates/web-sys/src/features/gen_GpuQueueDescriptor.rs index 8f4412ccfde..e96c645e2bd 100644 --- a/crates/web-sys/src/features/gen_GpuQueueDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuQueueDescriptor.rs @@ -14,6 +14,8 @@ 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 type GpuQueueDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuQueueDescriptor, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuQueueDescriptor { @@ -36,13 +38,7 @@ impl GpuQueueDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs index df29fdacca4..3100a8cda05 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs @@ -14,6 +14,8 @@ 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 type GpuRenderBundleDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuRenderBundleDescriptor, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuRenderBundleDescriptor { @@ -36,13 +38,7 @@ impl GpuRenderBundleDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs index c7857f88baa..82d76b71a56 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs @@ -14,6 +14,19 @@ 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 type GpuRenderBundleEncoderDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuRenderBundleEncoderDescriptor, val: &str); + #[wasm_bindgen(method, setter = "colorFormats")] + fn color_formats_shim(this: &GpuRenderBundleEncoderDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "depthStencilFormat")] + fn depth_stencil_format_shim(this: &GpuRenderBundleEncoderDescriptor, val: GpuTextureFormat); + #[wasm_bindgen(method, setter = "sampleCount")] + fn sample_count_shim(this: &GpuRenderBundleEncoderDescriptor, val: u32); + #[wasm_bindgen(method, setter = "depthReadOnly")] + fn depth_read_only_shim(this: &GpuRenderBundleEncoderDescriptor, val: bool); + #[wasm_bindgen(method, setter = "stencilReadOnly")] + fn stencil_read_only_shim(this: &GpuRenderBundleEncoderDescriptor, val: bool); } #[cfg(web_sys_unstable_apis)] impl GpuRenderBundleEncoderDescriptor { @@ -37,13 +50,7 @@ impl GpuRenderBundleEncoderDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +61,7 @@ impl GpuRenderBundleEncoderDescriptor { #[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 color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_formats_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,17 +73,7 @@ impl GpuRenderBundleEncoderDescriptor { #[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 depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_stencil_format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -97,17 +84,7 @@ impl GpuRenderBundleEncoderDescriptor { #[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 sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -118,17 +95,7 @@ impl GpuRenderBundleEncoderDescriptor { #[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 depth_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_read_only_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -139,17 +106,7 @@ impl GpuRenderBundleEncoderDescriptor { #[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 stencil_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_read_only_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs index 513ba98d251..d0506938272 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs @@ -14,6 +14,22 @@ 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 type GpuRenderPassColorAttachment; + #[wasm_bindgen(method, setter = "clearValue")] + fn clear_value_shim(this: &GpuRenderPassColorAttachment, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "depthSlice")] + fn depth_slice_shim(this: &GpuRenderPassColorAttachment, val: u32); + #[cfg(feature = "GpuLoadOp")] + #[wasm_bindgen(method, setter = "loadOp")] + fn load_op_shim(this: &GpuRenderPassColorAttachment, val: GpuLoadOp); + #[cfg(feature = "GpuTextureView")] + #[wasm_bindgen(method, setter = "resolveTarget")] + fn resolve_target_shim(this: &GpuRenderPassColorAttachment, val: &GpuTextureView); + #[cfg(feature = "GpuStoreOp")] + #[wasm_bindgen(method, setter = "storeOp")] + fn store_op_shim(this: &GpuRenderPassColorAttachment, val: GpuStoreOp); + #[cfg(feature = "GpuTextureView")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &GpuRenderPassColorAttachment, val: &GpuTextureView); } #[cfg(web_sys_unstable_apis)] impl GpuRenderPassColorAttachment { @@ -44,17 +60,7 @@ impl GpuRenderPassColorAttachment { #[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 clear_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clearValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clear_value_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -65,17 +71,7 @@ impl GpuRenderPassColorAttachment { #[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 depth_slice(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthSlice"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_slice_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -87,14 +83,7 @@ impl GpuRenderPassColorAttachment { #[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 load_op(&mut self, val: GpuLoadOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loadOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.load_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -106,17 +95,7 @@ impl GpuRenderPassColorAttachment { #[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 resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resolveTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.resolve_target_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -128,17 +107,7 @@ impl GpuRenderPassColorAttachment { #[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 store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storeOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.store_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -150,13 +119,7 @@ impl GpuRenderPassColorAttachment { #[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 view(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs index f08e15ee644..86f32e884fc 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs @@ -14,6 +14,29 @@ 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 type GpuRenderPassDepthStencilAttachment; + #[wasm_bindgen(method, setter = "depthClearValue")] + fn depth_clear_value_shim(this: &GpuRenderPassDepthStencilAttachment, val: f32); + #[cfg(feature = "GpuLoadOp")] + #[wasm_bindgen(method, setter = "depthLoadOp")] + fn depth_load_op_shim(this: &GpuRenderPassDepthStencilAttachment, val: GpuLoadOp); + #[wasm_bindgen(method, setter = "depthReadOnly")] + fn depth_read_only_shim(this: &GpuRenderPassDepthStencilAttachment, val: bool); + #[cfg(feature = "GpuStoreOp")] + #[wasm_bindgen(method, setter = "depthStoreOp")] + fn depth_store_op_shim(this: &GpuRenderPassDepthStencilAttachment, val: GpuStoreOp); + #[wasm_bindgen(method, setter = "stencilClearValue")] + fn stencil_clear_value_shim(this: &GpuRenderPassDepthStencilAttachment, val: u32); + #[cfg(feature = "GpuLoadOp")] + #[wasm_bindgen(method, setter = "stencilLoadOp")] + fn stencil_load_op_shim(this: &GpuRenderPassDepthStencilAttachment, val: GpuLoadOp); + #[wasm_bindgen(method, setter = "stencilReadOnly")] + fn stencil_read_only_shim(this: &GpuRenderPassDepthStencilAttachment, val: bool); + #[cfg(feature = "GpuStoreOp")] + #[wasm_bindgen(method, setter = "stencilStoreOp")] + fn stencil_store_op_shim(this: &GpuRenderPassDepthStencilAttachment, val: GpuStoreOp); + #[cfg(feature = "GpuTextureView")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &GpuRenderPassDepthStencilAttachment, val: &GpuTextureView); } #[cfg(web_sys_unstable_apis)] impl GpuRenderPassDepthStencilAttachment { @@ -38,17 +61,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 depth_clear_value(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthClearValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_clear_value_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,17 +73,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 depth_load_op(&mut self, val: GpuLoadOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthLoadOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_load_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +84,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 depth_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_read_only_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -103,17 +96,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 depth_store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStoreOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_store_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -124,17 +107,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 stencil_clear_value(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilClearValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_clear_value_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -146,17 +119,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 stencil_load_op(&mut self, val: GpuLoadOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilLoadOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_load_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -167,17 +130,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 stencil_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_read_only_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -189,17 +142,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 stencil_store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilStoreOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_store_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -211,13 +154,7 @@ impl GpuRenderPassDepthStencilAttachment { #[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 view(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs index 260f7fdaf2e..7ba69a91ec3 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs @@ -14,6 +14,24 @@ 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 type GpuRenderPassDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuRenderPassDescriptor, val: &str); + #[wasm_bindgen(method, setter = "colorAttachments")] + fn color_attachments_shim(this: &GpuRenderPassDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] + #[wasm_bindgen(method, setter = "depthStencilAttachment")] + fn depth_stencil_attachment_shim( + this: &GpuRenderPassDescriptor, + val: &GpuRenderPassDepthStencilAttachment, + ); + #[wasm_bindgen(method, setter = "maxDrawCount")] + fn max_draw_count_shim(this: &GpuRenderPassDescriptor, val: f64); + #[cfg(feature = "GpuQuerySet")] + #[wasm_bindgen(method, setter = "occlusionQuerySet")] + fn occlusion_query_set_shim(this: &GpuRenderPassDescriptor, val: &GpuQuerySet); + #[cfg(feature = "GpuRenderPassTimestampWrites")] + #[wasm_bindgen(method, setter = "timestampWrites")] + fn timestamp_writes_shim(this: &GpuRenderPassDescriptor, val: &GpuRenderPassTimestampWrites); } #[cfg(web_sys_unstable_apis)] impl GpuRenderPassDescriptor { @@ -37,13 +55,7 @@ impl GpuRenderPassDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +66,7 @@ impl GpuRenderPassDescriptor { #[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 color_attachments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorAttachments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_attachments_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +81,7 @@ impl GpuRenderPassDescriptor { &mut self, val: &GpuRenderPassDepthStencilAttachment, ) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilAttachment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_stencil_attachment_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,17 +92,7 @@ impl GpuRenderPassDescriptor { #[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 max_draw_count(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDrawCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_draw_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -122,17 +104,7 @@ impl GpuRenderPassDescriptor { #[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 occlusion_query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("occlusionQuerySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.occlusion_query_set_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -144,17 +116,7 @@ impl GpuRenderPassDescriptor { #[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 timestamp_writes(&mut self, val: &GpuRenderPassTimestampWrites) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestampWrites"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_writes_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs b/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs index b056eb51cbf..8ae5c2d3616 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs @@ -14,6 +14,15 @@ 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 type GpuRenderPassLayout; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuRenderPassLayout, val: &str); + #[wasm_bindgen(method, setter = "colorFormats")] + fn color_formats_shim(this: &GpuRenderPassLayout, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "depthStencilFormat")] + fn depth_stencil_format_shim(this: &GpuRenderPassLayout, val: GpuTextureFormat); + #[wasm_bindgen(method, setter = "sampleCount")] + fn sample_count_shim(this: &GpuRenderPassLayout, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuRenderPassLayout { @@ -37,13 +46,7 @@ impl GpuRenderPassLayout { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +57,7 @@ impl GpuRenderPassLayout { #[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 color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_formats_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,17 +69,7 @@ impl GpuRenderPassLayout { #[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 depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_stencil_format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -97,17 +80,7 @@ impl GpuRenderPassLayout { #[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 sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_count_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs b/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs index 4d72aa93b28..3a97f58b8c7 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs @@ -14,6 +14,13 @@ 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 type GpuRenderPassTimestampWrites; + #[wasm_bindgen(method, setter = "beginningOfPassWriteIndex")] + fn beginning_of_pass_write_index_shim(this: &GpuRenderPassTimestampWrites, val: u32); + #[wasm_bindgen(method, setter = "endOfPassWriteIndex")] + fn end_of_pass_write_index_shim(this: &GpuRenderPassTimestampWrites, val: u32); + #[cfg(feature = "GpuQuerySet")] + #[wasm_bindgen(method, setter = "querySet")] + fn query_set_shim(this: &GpuRenderPassTimestampWrites, val: &GpuQuerySet); } #[cfg(web_sys_unstable_apis)] impl GpuRenderPassTimestampWrites { @@ -38,17 +45,7 @@ impl GpuRenderPassTimestampWrites { #[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 beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("beginningOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.beginning_of_pass_write_index_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +56,7 @@ impl GpuRenderPassTimestampWrites { #[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 end_of_pass_write_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endOfPassWriteIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_of_pass_write_index_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +68,7 @@ impl GpuRenderPassTimestampWrites { #[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 query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("querySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.query_set_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs index 13f705a5b28..02dc5eec076 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs @@ -14,6 +14,25 @@ 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 type GpuRenderPipelineDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuRenderPipelineDescriptor, val: &str); + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &GpuRenderPipelineDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuDepthStencilState")] + #[wasm_bindgen(method, setter = "depthStencil")] + fn depth_stencil_shim(this: &GpuRenderPipelineDescriptor, val: &GpuDepthStencilState); + #[cfg(feature = "GpuFragmentState")] + #[wasm_bindgen(method, setter = "fragment")] + fn fragment_shim(this: &GpuRenderPipelineDescriptor, val: &GpuFragmentState); + #[cfg(feature = "GpuMultisampleState")] + #[wasm_bindgen(method, setter = "multisample")] + fn multisample_shim(this: &GpuRenderPipelineDescriptor, val: &GpuMultisampleState); + #[cfg(feature = "GpuPrimitiveState")] + #[wasm_bindgen(method, setter = "primitive")] + fn primitive_shim(this: &GpuRenderPipelineDescriptor, val: &GpuPrimitiveState); + #[cfg(feature = "GpuVertexState")] + #[wasm_bindgen(method, setter = "vertex")] + fn vertex_shim(this: &GpuRenderPipelineDescriptor, val: &GpuVertexState); } #[cfg(web_sys_unstable_apis)] impl GpuRenderPipelineDescriptor { @@ -39,13 +58,7 @@ impl GpuRenderPipelineDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,14 +69,7 @@ impl GpuRenderPipelineDescriptor { #[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 layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +81,7 @@ impl GpuRenderPipelineDescriptor { #[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 depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_stencil_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -97,17 +93,7 @@ impl GpuRenderPipelineDescriptor { #[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 fragment(&mut self, val: &GpuFragmentState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fragment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fragment_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -119,17 +105,7 @@ impl GpuRenderPipelineDescriptor { #[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 multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multisample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.multisample_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -141,17 +117,7 @@ impl GpuRenderPipelineDescriptor { #[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 primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("primitive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.primitive_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -163,14 +129,7 @@ impl GpuRenderPipelineDescriptor { #[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 vertex(&mut self, val: &GpuVertexState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("vertex"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.vertex_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs index 843122598e4..084385ffb36 100644 --- a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs +++ b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs @@ -14,6 +14,11 @@ 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 type GpuRequestAdapterOptions; + #[wasm_bindgen(method, setter = "forceFallbackAdapter")] + fn force_fallback_adapter_shim(this: &GpuRequestAdapterOptions, val: bool); + #[cfg(feature = "GpuPowerPreference")] + #[wasm_bindgen(method, setter = "powerPreference")] + fn power_preference_shim(this: &GpuRequestAdapterOptions, val: GpuPowerPreference); } #[cfg(web_sys_unstable_apis)] impl GpuRequestAdapterOptions { @@ -36,17 +41,7 @@ impl GpuRequestAdapterOptions { #[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 force_fallback_adapter(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("forceFallbackAdapter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.force_fallback_adapter_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +53,7 @@ impl GpuRequestAdapterOptions { #[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 power_preference(&mut self, val: GpuPowerPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("powerPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.power_preference_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs b/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs index 3112b75339a..87da31c0180 100644 --- a/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs @@ -14,6 +14,9 @@ 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 type GpuSamplerBindingLayout; + #[cfg(feature = "GpuSamplerBindingType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &GpuSamplerBindingLayout, val: GpuSamplerBindingType); } #[cfg(web_sys_unstable_apis)] impl GpuSamplerBindingLayout { @@ -37,13 +40,7 @@ impl GpuSamplerBindingLayout { #[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 type_(&mut self, val: GpuSamplerBindingType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs b/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs index 5ac008aee95..eecc6c14c96 100644 --- a/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs @@ -14,6 +14,35 @@ 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 type GpuSamplerDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuSamplerDescriptor, val: &str); + #[cfg(feature = "GpuAddressMode")] + #[wasm_bindgen(method, setter = "addressModeU")] + fn address_mode_u_shim(this: &GpuSamplerDescriptor, val: GpuAddressMode); + #[cfg(feature = "GpuAddressMode")] + #[wasm_bindgen(method, setter = "addressModeV")] + fn address_mode_v_shim(this: &GpuSamplerDescriptor, val: GpuAddressMode); + #[cfg(feature = "GpuAddressMode")] + #[wasm_bindgen(method, setter = "addressModeW")] + fn address_mode_w_shim(this: &GpuSamplerDescriptor, val: GpuAddressMode); + #[cfg(feature = "GpuCompareFunction")] + #[wasm_bindgen(method, setter = "compare")] + fn compare_shim(this: &GpuSamplerDescriptor, val: GpuCompareFunction); + #[wasm_bindgen(method, setter = "lodMaxClamp")] + fn lod_max_clamp_shim(this: &GpuSamplerDescriptor, val: f32); + #[wasm_bindgen(method, setter = "lodMinClamp")] + fn lod_min_clamp_shim(this: &GpuSamplerDescriptor, val: f32); + #[cfg(feature = "GpuFilterMode")] + #[wasm_bindgen(method, setter = "magFilter")] + fn mag_filter_shim(this: &GpuSamplerDescriptor, val: GpuFilterMode); + #[wasm_bindgen(method, setter = "maxAnisotropy")] + fn max_anisotropy_shim(this: &GpuSamplerDescriptor, val: u16); + #[cfg(feature = "GpuFilterMode")] + #[wasm_bindgen(method, setter = "minFilter")] + fn min_filter_shim(this: &GpuSamplerDescriptor, val: GpuFilterMode); + #[cfg(feature = "GpuMipmapFilterMode")] + #[wasm_bindgen(method, setter = "mipmapFilter")] + fn mipmap_filter_shim(this: &GpuSamplerDescriptor, val: GpuMipmapFilterMode); } #[cfg(web_sys_unstable_apis)] impl GpuSamplerDescriptor { @@ -36,13 +65,7 @@ impl GpuSamplerDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +77,7 @@ impl GpuSamplerDescriptor { #[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 address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeU"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.address_mode_u_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,17 +89,7 @@ impl GpuSamplerDescriptor { #[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 address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeV"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.address_mode_v_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -98,17 +101,7 @@ impl GpuSamplerDescriptor { #[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 address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeW"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.address_mode_w_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -120,17 +113,7 @@ impl GpuSamplerDescriptor { #[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 compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.compare_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -141,17 +124,7 @@ impl GpuSamplerDescriptor { #[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 lod_max_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lodMaxClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lod_max_clamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -162,17 +135,7 @@ impl GpuSamplerDescriptor { #[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 lod_min_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lodMinClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lod_min_clamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -184,17 +147,7 @@ impl GpuSamplerDescriptor { #[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 mag_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("magFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mag_filter_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -205,17 +158,7 @@ impl GpuSamplerDescriptor { #[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 max_anisotropy(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxAnisotropy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_anisotropy_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -227,17 +170,7 @@ impl GpuSamplerDescriptor { #[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 min_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_filter_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -249,17 +182,7 @@ impl GpuSamplerDescriptor { #[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 mipmap_filter(&mut self, val: GpuMipmapFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipmapFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mipmap_filter_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs b/crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs index 1793d68dcbf..872f504ce07 100644 --- a/crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs +++ b/crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs @@ -14,6 +14,10 @@ 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 type GpuShaderModuleCompilationHint; + #[wasm_bindgen(method, setter = "entryPoint")] + fn entry_point_shim(this: &GpuShaderModuleCompilationHint, val: &str); + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &GpuShaderModuleCompilationHint, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuShaderModuleCompilationHint { @@ -37,17 +41,7 @@ impl GpuShaderModuleCompilationHint { #[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 entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_point_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,14 +52,7 @@ impl GpuShaderModuleCompilationHint { #[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 layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs b/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs index 74255136180..f8ed57202ac 100644 --- a/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs @@ -14,6 +14,14 @@ 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 type GpuShaderModuleDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuShaderModuleDescriptor, val: &str); + #[wasm_bindgen(method, setter = "code")] + fn code_shim(this: &GpuShaderModuleDescriptor, val: &str); + #[wasm_bindgen(method, setter = "compilationHints")] + fn compilation_hints_shim(this: &GpuShaderModuleDescriptor, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "sourceMap")] + fn source_map_shim(this: &GpuShaderModuleDescriptor, val: &::js_sys::Object); } #[cfg(web_sys_unstable_apis)] impl GpuShaderModuleDescriptor { @@ -37,13 +45,7 @@ impl GpuShaderModuleDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,13 +56,7 @@ impl GpuShaderModuleDescriptor { #[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 code(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.code_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -71,17 +67,7 @@ impl GpuShaderModuleDescriptor { #[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 compilation_hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compilationHints"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.compilation_hints_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -92,17 +78,7 @@ impl GpuShaderModuleDescriptor { #[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 source_map(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceMap"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_map_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuStencilFaceState.rs b/crates/web-sys/src/features/gen_GpuStencilFaceState.rs index 4c4eebc4704..aa72d7b9431 100644 --- a/crates/web-sys/src/features/gen_GpuStencilFaceState.rs +++ b/crates/web-sys/src/features/gen_GpuStencilFaceState.rs @@ -14,6 +14,18 @@ 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 type GpuStencilFaceState; + #[cfg(feature = "GpuCompareFunction")] + #[wasm_bindgen(method, setter = "compare")] + fn compare_shim(this: &GpuStencilFaceState, val: GpuCompareFunction); + #[cfg(feature = "GpuStencilOperation")] + #[wasm_bindgen(method, setter = "depthFailOp")] + fn depth_fail_op_shim(this: &GpuStencilFaceState, val: GpuStencilOperation); + #[cfg(feature = "GpuStencilOperation")] + #[wasm_bindgen(method, setter = "failOp")] + fn fail_op_shim(this: &GpuStencilFaceState, val: GpuStencilOperation); + #[cfg(feature = "GpuStencilOperation")] + #[wasm_bindgen(method, setter = "passOp")] + fn pass_op_shim(this: &GpuStencilFaceState, val: GpuStencilOperation); } #[cfg(web_sys_unstable_apis)] impl GpuStencilFaceState { @@ -37,17 +49,7 @@ impl GpuStencilFaceState { #[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 compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.compare_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +61,7 @@ impl GpuStencilFaceState { #[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 depth_fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthFailOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_fail_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,14 +73,7 @@ impl GpuStencilFaceState { #[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 fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("failOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fail_op_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,14 +85,7 @@ impl GpuStencilFaceState { #[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 pass_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("passOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pass_op_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs index 1d3f5ff145a..36adc75a02f 100644 --- a/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs @@ -14,6 +14,15 @@ 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 type GpuStorageTextureBindingLayout; + #[cfg(feature = "GpuStorageTextureAccess")] + #[wasm_bindgen(method, setter = "access")] + fn access_shim(this: &GpuStorageTextureBindingLayout, val: GpuStorageTextureAccess); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuStorageTextureBindingLayout, val: GpuTextureFormat); + #[cfg(feature = "GpuTextureViewDimension")] + #[wasm_bindgen(method, setter = "viewDimension")] + fn view_dimension_shim(this: &GpuStorageTextureBindingLayout, val: GpuTextureViewDimension); } #[cfg(web_sys_unstable_apis)] impl GpuStorageTextureBindingLayout { @@ -39,14 +48,7 @@ impl GpuStorageTextureBindingLayout { #[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 access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("access"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.access_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,14 +60,7 @@ impl GpuStorageTextureBindingLayout { #[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 format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +72,7 @@ impl GpuStorageTextureBindingLayout { #[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 view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewDimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_dimension_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs index 65551e9ac13..ccd9bfc620c 100644 --- a/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs @@ -14,6 +14,14 @@ 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 type GpuTextureBindingLayout; + #[wasm_bindgen(method, setter = "multisampled")] + fn multisampled_shim(this: &GpuTextureBindingLayout, val: bool); + #[cfg(feature = "GpuTextureSampleType")] + #[wasm_bindgen(method, setter = "sampleType")] + fn sample_type_shim(this: &GpuTextureBindingLayout, val: GpuTextureSampleType); + #[cfg(feature = "GpuTextureViewDimension")] + #[wasm_bindgen(method, setter = "viewDimension")] + fn view_dimension_shim(this: &GpuTextureBindingLayout, val: GpuTextureViewDimension); } #[cfg(web_sys_unstable_apis)] impl GpuTextureBindingLayout { @@ -36,17 +44,7 @@ impl GpuTextureBindingLayout { #[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 multisampled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multisampled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.multisampled_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +56,7 @@ impl GpuTextureBindingLayout { #[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 sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_type_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +68,7 @@ impl GpuTextureBindingLayout { #[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 view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewDimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_dimension_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs b/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs index f7cb4f66849..b79eccc02d3 100644 --- a/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs @@ -14,6 +14,24 @@ 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 type GpuTextureDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuTextureDescriptor, val: &str); + #[cfg(feature = "GpuTextureDimension")] + #[wasm_bindgen(method, setter = "dimension")] + fn dimension_shim(this: &GpuTextureDescriptor, val: GpuTextureDimension); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuTextureDescriptor, val: GpuTextureFormat); + #[wasm_bindgen(method, setter = "mipLevelCount")] + fn mip_level_count_shim(this: &GpuTextureDescriptor, val: u32); + #[wasm_bindgen(method, setter = "sampleCount")] + fn sample_count_shim(this: &GpuTextureDescriptor, val: u32); + #[wasm_bindgen(method, setter = "size")] + fn size_shim(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "usage")] + fn usage_shim(this: &GpuTextureDescriptor, val: u32); + #[wasm_bindgen(method, setter = "viewFormats")] + fn view_formats_shim(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuTextureDescriptor { @@ -40,13 +58,7 @@ impl GpuTextureDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +70,7 @@ impl GpuTextureDescriptor { #[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 dimension(&mut self, val: GpuTextureDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dimension_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,14 +82,7 @@ impl GpuTextureDescriptor { #[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 format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -98,17 +93,7 @@ impl GpuTextureDescriptor { #[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 mip_level_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mip_level_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -119,17 +104,7 @@ impl GpuTextureDescriptor { #[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 sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -140,13 +115,7 @@ impl GpuTextureDescriptor { #[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 size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.size_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -157,13 +126,7 @@ impl GpuTextureDescriptor { #[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 usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -174,17 +137,7 @@ impl GpuTextureDescriptor { #[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 view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_formats_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs b/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs index 30b8fc31c76..e6b85aacd3f 100644 --- a/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs @@ -14,6 +14,25 @@ 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 type GpuTextureViewDescriptor; + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &GpuTextureViewDescriptor, val: &str); + #[wasm_bindgen(method, setter = "arrayLayerCount")] + fn array_layer_count_shim(this: &GpuTextureViewDescriptor, val: u32); + #[cfg(feature = "GpuTextureAspect")] + #[wasm_bindgen(method, setter = "aspect")] + fn aspect_shim(this: &GpuTextureViewDescriptor, val: GpuTextureAspect); + #[wasm_bindgen(method, setter = "baseArrayLayer")] + fn base_array_layer_shim(this: &GpuTextureViewDescriptor, val: u32); + #[wasm_bindgen(method, setter = "baseMipLevel")] + fn base_mip_level_shim(this: &GpuTextureViewDescriptor, val: u32); + #[cfg(feature = "GpuTextureViewDimension")] + #[wasm_bindgen(method, setter = "dimension")] + fn dimension_shim(this: &GpuTextureViewDescriptor, val: GpuTextureViewDimension); + #[cfg(feature = "GpuTextureFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuTextureViewDescriptor, val: GpuTextureFormat); + #[wasm_bindgen(method, setter = "mipLevelCount")] + fn mip_level_count_shim(this: &GpuTextureViewDescriptor, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuTextureViewDescriptor { @@ -36,13 +55,7 @@ impl GpuTextureViewDescriptor { #[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 label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,17 +66,7 @@ impl GpuTextureViewDescriptor { #[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 array_layer_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arrayLayerCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.array_layer_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,14 +78,7 @@ impl GpuTextureViewDescriptor { #[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 aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.aspect_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -93,17 +89,7 @@ impl GpuTextureViewDescriptor { #[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 base_array_layer(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseArrayLayer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.base_array_layer_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -114,17 +100,7 @@ impl GpuTextureViewDescriptor { #[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 base_mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseMipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.base_mip_level_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -136,17 +112,7 @@ impl GpuTextureViewDescriptor { #[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 dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dimension_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -158,14 +124,7 @@ impl GpuTextureViewDescriptor { #[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 format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -176,17 +135,7 @@ impl GpuTextureViewDescriptor { #[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 mip_level_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mip_level_count_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs b/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs index 8674ca879fd..276f6d2ddd5 100644 --- a/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs @@ -14,6 +14,15 @@ 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 type GpuUncapturedErrorEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &GpuUncapturedErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &GpuUncapturedErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &GpuUncapturedErrorEventInit, val: bool); + #[cfg(feature = "GpuError")] + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &GpuUncapturedErrorEventInit, val: &GpuError); } #[cfg(web_sys_unstable_apis)] impl GpuUncapturedErrorEventInit { @@ -38,17 +47,7 @@ impl GpuUncapturedErrorEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +58,7 @@ impl GpuUncapturedErrorEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +69,7 @@ impl GpuUncapturedErrorEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,13 +81,7 @@ impl GpuUncapturedErrorEventInit { #[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 error(&mut self, val: &GpuError) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuVertexAttribute.rs b/crates/web-sys/src/features/gen_GpuVertexAttribute.rs index f70761628ac..630b6daa18f 100644 --- a/crates/web-sys/src/features/gen_GpuVertexAttribute.rs +++ b/crates/web-sys/src/features/gen_GpuVertexAttribute.rs @@ -14,6 +14,13 @@ 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 type GpuVertexAttribute; + #[cfg(feature = "GpuVertexFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &GpuVertexAttribute, val: GpuVertexFormat); + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &GpuVertexAttribute, val: f64); + #[wasm_bindgen(method, setter = "shaderLocation")] + fn shader_location_shim(this: &GpuVertexAttribute, val: u32); } #[cfg(web_sys_unstable_apis)] impl GpuVertexAttribute { @@ -41,14 +48,7 @@ impl GpuVertexAttribute { #[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 format(&mut self, val: GpuVertexFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,14 +59,7 @@ impl GpuVertexAttribute { #[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 offset(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +70,7 @@ impl GpuVertexAttribute { #[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 shader_location(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shaderLocation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shader_location_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs b/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs index 18a3dc0f5ad..21594f7bab8 100644 --- a/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs +++ b/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs @@ -14,6 +14,13 @@ 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 type GpuVertexBufferLayout; + #[wasm_bindgen(method, setter = "arrayStride")] + fn array_stride_shim(this: &GpuVertexBufferLayout, val: f64); + #[wasm_bindgen(method, setter = "attributes")] + fn attributes_shim(this: &GpuVertexBufferLayout, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "GpuVertexStepMode")] + #[wasm_bindgen(method, setter = "stepMode")] + fn step_mode_shim(this: &GpuVertexBufferLayout, val: GpuVertexStepMode); } #[cfg(web_sys_unstable_apis)] impl GpuVertexBufferLayout { @@ -38,17 +45,7 @@ impl GpuVertexBufferLayout { #[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 array_stride(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arrayStride"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.array_stride_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +56,7 @@ impl GpuVertexBufferLayout { #[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 attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attributes_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +68,7 @@ impl GpuVertexBufferLayout { #[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 step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stepMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.step_mode_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuVertexState.rs b/crates/web-sys/src/features/gen_GpuVertexState.rs index aa0259bd31d..6b841d11fdf 100644 --- a/crates/web-sys/src/features/gen_GpuVertexState.rs +++ b/crates/web-sys/src/features/gen_GpuVertexState.rs @@ -14,6 +14,13 @@ 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 type GpuVertexState; + #[wasm_bindgen(method, setter = "entryPoint")] + fn entry_point_shim(this: &GpuVertexState, val: &str); + #[cfg(feature = "GpuShaderModule")] + #[wasm_bindgen(method, setter = "module")] + fn module_shim(this: &GpuVertexState, val: &GpuShaderModule); + #[wasm_bindgen(method, setter = "buffers")] + fn buffers_shim(this: &GpuVertexState, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl GpuVertexState { @@ -38,17 +45,7 @@ impl GpuVertexState { #[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 entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_point_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,14 +57,7 @@ impl GpuVertexState { #[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 module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.module_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +68,7 @@ impl GpuVertexState { #[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 buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buffers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffers_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs b/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs index b543871515e..73528f6bc37 100644 --- a/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs +++ b/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] pub type GroupedHistoryEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &GroupedHistoryEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &GroupedHistoryEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &GroupedHistoryEventInit, val: bool); + #[cfg(feature = "Element")] + #[wasm_bindgen(method, setter = "otherBrowser")] + fn other_browser_shim(this: &GroupedHistoryEventInit, val: Option<&Element>); } impl GroupedHistoryEventInit { #[doc = "Construct a new `GroupedHistoryEventInit`."] @@ -24,51 +33,21 @@ impl GroupedHistoryEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Element")] @@ -76,17 +55,7 @@ impl GroupedHistoryEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `GroupedHistoryEventInit`*"] pub fn other_browser(&mut self, val: Option<&Element>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("otherBrowser"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.other_browser_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs b/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs index e3c566c2b98..56caf74fac2 100644 --- a/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs +++ b/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HalfOpenInfoDict`*"] pub type HalfOpenInfoDict; + #[wasm_bindgen(method, setter = "speculative")] + fn speculative_shim(this: &HalfOpenInfoDict, val: bool); } impl HalfOpenInfoDict { #[doc = "Construct a new `HalfOpenInfoDict`."] @@ -24,17 +26,7 @@ impl HalfOpenInfoDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HalfOpenInfoDict`*"] pub fn speculative(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("speculative"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.speculative_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HashChangeEventInit.rs b/crates/web-sys/src/features/gen_HashChangeEventInit.rs index 879339a1321..784fbfc5dee 100644 --- a/crates/web-sys/src/features/gen_HashChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_HashChangeEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub type HashChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &HashChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &HashChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &HashChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "newURL")] + fn new_url_shim(this: &HashChangeEventInit, val: &str); + #[wasm_bindgen(method, setter = "oldURL")] + fn old_url_shim(this: &HashChangeEventInit, val: &str); } impl HashChangeEventInit { #[doc = "Construct a new `HashChangeEventInit`."] @@ -24,79 +34,35 @@ impl HashChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `newURL` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub fn new_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("newURL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.new_url_shim(val); self } #[doc = "Change the `oldURL` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub fn old_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("oldURL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.old_url_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidCollectionInfo.rs b/crates/web-sys/src/features/gen_HidCollectionInfo.rs index 5bf395ad0c2..6a99d71e18c 100644 --- a/crates/web-sys/src/features/gen_HidCollectionInfo.rs +++ b/crates/web-sys/src/features/gen_HidCollectionInfo.rs @@ -14,6 +14,20 @@ 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 type HidCollectionInfo; + #[wasm_bindgen(method, setter = "children")] + fn children_shim(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "featureReports")] + fn feature_reports_shim(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "inputReports")] + fn input_reports_shim(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "outputReports")] + fn output_reports_shim(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &HidCollectionInfo, val: u8); + #[wasm_bindgen(method, setter = "usage")] + fn usage_shim(this: &HidCollectionInfo, val: u16); + #[wasm_bindgen(method, setter = "usagePage")] + fn usage_page_shim(this: &HidCollectionInfo, val: u16); } #[cfg(web_sys_unstable_apis)] impl HidCollectionInfo { @@ -36,17 +50,7 @@ impl HidCollectionInfo { #[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 children(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("children"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.children_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +61,7 @@ impl HidCollectionInfo { #[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 feature_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("featureReports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.feature_reports_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +72,7 @@ impl HidCollectionInfo { #[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 input_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inputReports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.input_reports_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +83,7 @@ impl HidCollectionInfo { #[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 output_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("outputReports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.output_reports_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -120,13 +94,7 @@ impl HidCollectionInfo { #[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 type_(&mut self, val: u8) -> &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.type__shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -137,13 +105,7 @@ impl HidCollectionInfo { #[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 usage(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -154,17 +116,7 @@ impl HidCollectionInfo { #[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 usage_page(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usagePage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_page_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidConnectionEventInit.rs b/crates/web-sys/src/features/gen_HidConnectionEventInit.rs index 5b01844210a..29201bb43b2 100644 --- a/crates/web-sys/src/features/gen_HidConnectionEventInit.rs +++ b/crates/web-sys/src/features/gen_HidConnectionEventInit.rs @@ -14,6 +14,15 @@ 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 type HidConnectionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &HidConnectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &HidConnectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &HidConnectionEventInit, val: bool); + #[cfg(feature = "HidDevice")] + #[wasm_bindgen(method, setter = "device")] + fn device_shim(this: &HidConnectionEventInit, val: &HidDevice); } #[cfg(web_sys_unstable_apis)] impl HidConnectionEventInit { @@ -38,17 +47,7 @@ impl HidConnectionEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +58,7 @@ impl HidConnectionEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +69,7 @@ impl HidConnectionEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,14 +81,7 @@ impl HidConnectionEventInit { #[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 device(&mut self, val: &HidDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidDeviceFilter.rs b/crates/web-sys/src/features/gen_HidDeviceFilter.rs index f82a205389f..88c21dbc771 100644 --- a/crates/web-sys/src/features/gen_HidDeviceFilter.rs +++ b/crates/web-sys/src/features/gen_HidDeviceFilter.rs @@ -14,6 +14,14 @@ 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 type HidDeviceFilter; + #[wasm_bindgen(method, setter = "productId")] + fn product_id_shim(this: &HidDeviceFilter, val: u16); + #[wasm_bindgen(method, setter = "usage")] + fn usage_shim(this: &HidDeviceFilter, val: u16); + #[wasm_bindgen(method, setter = "usagePage")] + fn usage_page_shim(this: &HidDeviceFilter, val: u16); + #[wasm_bindgen(method, setter = "vendorId")] + fn vendor_id_shim(this: &HidDeviceFilter, val: u32); } #[cfg(web_sys_unstable_apis)] impl HidDeviceFilter { @@ -36,17 +44,7 @@ impl HidDeviceFilter { #[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 product_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("productId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.product_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +55,7 @@ impl HidDeviceFilter { #[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 usage(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +66,7 @@ impl HidDeviceFilter { #[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 usage_page(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usagePage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_page_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,17 +77,7 @@ impl HidDeviceFilter { #[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 vendor_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.vendor_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs b/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs index 2193db4d3bb..ad2ec1f3758 100644 --- a/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs +++ b/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs @@ -14,6 +14,8 @@ 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 type HidDeviceRequestOptions; + #[wasm_bindgen(method, setter = "filters")] + fn filters_shim(this: &HidDeviceRequestOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl HidDeviceRequestOptions { @@ -37,17 +39,7 @@ impl HidDeviceRequestOptions { #[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 filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filters_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidInputReportEventInit.rs b/crates/web-sys/src/features/gen_HidInputReportEventInit.rs index c31c86886c2..6defeeec352 100644 --- a/crates/web-sys/src/features/gen_HidInputReportEventInit.rs +++ b/crates/web-sys/src/features/gen_HidInputReportEventInit.rs @@ -14,6 +14,19 @@ 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 type HidInputReportEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &HidInputReportEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &HidInputReportEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &HidInputReportEventInit, val: bool); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &HidInputReportEventInit, val: &::js_sys::DataView); + #[cfg(feature = "HidDevice")] + #[wasm_bindgen(method, setter = "device")] + fn device_shim(this: &HidInputReportEventInit, val: &HidDevice); + #[wasm_bindgen(method, setter = "reportId")] + fn report_id_shim(this: &HidInputReportEventInit, val: u8); } #[cfg(web_sys_unstable_apis)] impl HidInputReportEventInit { @@ -40,17 +53,7 @@ impl HidInputReportEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -61,17 +64,7 @@ impl HidInputReportEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -82,17 +75,7 @@ impl HidInputReportEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -103,13 +86,7 @@ impl HidInputReportEventInit { #[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 data(&mut self, val: &::js_sys::DataView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -121,14 +98,7 @@ impl HidInputReportEventInit { #[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 device(&mut self, val: &HidDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -139,17 +109,7 @@ impl HidInputReportEventInit { #[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 report_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.report_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidReportInfo.rs b/crates/web-sys/src/features/gen_HidReportInfo.rs index d68a9a07d09..9ed35faa805 100644 --- a/crates/web-sys/src/features/gen_HidReportInfo.rs +++ b/crates/web-sys/src/features/gen_HidReportInfo.rs @@ -14,6 +14,10 @@ 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 type HidReportInfo; + #[wasm_bindgen(method, setter = "items")] + fn items_shim(this: &HidReportInfo, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "reportId")] + fn report_id_shim(this: &HidReportInfo, val: u8); } #[cfg(web_sys_unstable_apis)] impl HidReportInfo { @@ -36,13 +40,7 @@ impl HidReportInfo { #[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 items(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("items"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.items_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,17 +51,7 @@ impl HidReportInfo { #[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 report_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.report_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HidReportItem.rs b/crates/web-sys/src/features/gen_HidReportItem.rs index 72c07abb771..c4d98dd12fb 100644 --- a/crates/web-sys/src/features/gen_HidReportItem.rs +++ b/crates/web-sys/src/features/gen_HidReportItem.rs @@ -14,6 +14,63 @@ 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 type HidReportItem; + #[wasm_bindgen(method, setter = "hasNull")] + fn has_null_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "hasPreferredState")] + fn has_preferred_state_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isAbsolute")] + fn is_absolute_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isArray")] + fn is_array_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isBufferedBytes")] + fn is_buffered_bytes_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isConstant")] + fn is_constant_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isLinear")] + fn is_linear_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isRange")] + fn is_range_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "isVolatile")] + fn is_volatile_shim(this: &HidReportItem, val: bool); + #[wasm_bindgen(method, setter = "logicalMaximum")] + fn logical_maximum_shim(this: &HidReportItem, val: i32); + #[wasm_bindgen(method, setter = "logicalMinimum")] + fn logical_minimum_shim(this: &HidReportItem, val: i32); + #[wasm_bindgen(method, setter = "physicalMaximum")] + fn physical_maximum_shim(this: &HidReportItem, val: i32); + #[wasm_bindgen(method, setter = "physicalMinimum")] + fn physical_minimum_shim(this: &HidReportItem, val: i32); + #[wasm_bindgen(method, setter = "reportCount")] + fn report_count_shim(this: &HidReportItem, val: u16); + #[wasm_bindgen(method, setter = "reportSize")] + fn report_size_shim(this: &HidReportItem, val: u16); + #[wasm_bindgen(method, setter = "strings")] + fn strings_shim(this: &HidReportItem, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "unitExponent")] + fn unit_exponent_shim(this: &HidReportItem, val: i8); + #[wasm_bindgen(method, setter = "unitFactorCurrentExponent")] + fn unit_factor_current_exponent_shim(this: &HidReportItem, val: i8); + #[wasm_bindgen(method, setter = "unitFactorLengthExponent")] + fn unit_factor_length_exponent_shim(this: &HidReportItem, val: i8); + #[wasm_bindgen(method, setter = "unitFactorLuminousIntensityExponent")] + fn unit_factor_luminous_intensity_exponent_shim(this: &HidReportItem, val: i8); + #[wasm_bindgen(method, setter = "unitFactorMassExponent")] + fn unit_factor_mass_exponent_shim(this: &HidReportItem, val: i8); + #[wasm_bindgen(method, setter = "unitFactorTemperatureExponent")] + fn unit_factor_temperature_exponent_shim(this: &HidReportItem, val: i8); + #[wasm_bindgen(method, setter = "unitFactorTimeExponent")] + fn unit_factor_time_exponent_shim(this: &HidReportItem, val: i8); + #[cfg(feature = "HidUnitSystem")] + #[wasm_bindgen(method, setter = "unitSystem")] + fn unit_system_shim(this: &HidReportItem, val: HidUnitSystem); + #[wasm_bindgen(method, setter = "usageMaximum")] + fn usage_maximum_shim(this: &HidReportItem, val: u32); + #[wasm_bindgen(method, setter = "usageMinimum")] + fn usage_minimum_shim(this: &HidReportItem, val: u32); + #[wasm_bindgen(method, setter = "usages")] + fn usages_shim(this: &HidReportItem, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "wrap")] + fn wrap_shim(this: &HidReportItem, val: bool); } #[cfg(web_sys_unstable_apis)] impl HidReportItem { @@ -36,17 +93,7 @@ impl HidReportItem { #[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 has_null(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasNull"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.has_null_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +104,7 @@ impl HidReportItem { #[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 has_preferred_state(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasPreferredState"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.has_preferred_state_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +115,7 @@ impl HidReportItem { #[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 is_absolute(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isAbsolute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_absolute_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +126,7 @@ impl HidReportItem { #[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 is_array(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isArray"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_array_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -120,17 +137,7 @@ impl HidReportItem { #[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 is_buffered_bytes(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isBufferedBytes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_buffered_bytes_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -141,17 +148,7 @@ impl HidReportItem { #[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 is_constant(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isConstant"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_constant_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -162,17 +159,7 @@ impl HidReportItem { #[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 is_linear(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isLinear"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_linear_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -183,17 +170,7 @@ impl HidReportItem { #[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 is_range(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRange"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_range_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -204,17 +181,7 @@ impl HidReportItem { #[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 is_volatile(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isVolatile"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_volatile_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -225,17 +192,7 @@ impl HidReportItem { #[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 logical_maximum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("logicalMaximum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.logical_maximum_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -246,17 +203,7 @@ impl HidReportItem { #[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 logical_minimum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("logicalMinimum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.logical_minimum_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -267,17 +214,7 @@ impl HidReportItem { #[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 physical_maximum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("physicalMaximum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.physical_maximum_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -288,17 +225,7 @@ impl HidReportItem { #[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 physical_minimum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("physicalMinimum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.physical_minimum_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -309,17 +236,7 @@ impl HidReportItem { #[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 report_count(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.report_count_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -330,17 +247,7 @@ impl HidReportItem { #[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 report_size(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.report_size_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -351,17 +258,7 @@ impl HidReportItem { #[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 strings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("strings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.strings_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -372,17 +269,7 @@ impl HidReportItem { #[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 unit_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -393,17 +280,7 @@ impl HidReportItem { #[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 unit_factor_current_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorCurrentExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_factor_current_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -414,17 +291,7 @@ impl HidReportItem { #[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 unit_factor_length_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorLengthExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_factor_length_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -435,17 +302,7 @@ impl HidReportItem { #[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 unit_factor_luminous_intensity_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorLuminousIntensityExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_factor_luminous_intensity_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -456,17 +313,7 @@ impl HidReportItem { #[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 unit_factor_mass_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorMassExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_factor_mass_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -477,17 +324,7 @@ impl HidReportItem { #[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 unit_factor_temperature_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorTemperatureExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_factor_temperature_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -498,17 +335,7 @@ impl HidReportItem { #[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 unit_factor_time_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorTimeExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_factor_time_exponent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -520,17 +347,7 @@ impl HidReportItem { #[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 unit_system(&mut self, val: HidUnitSystem) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitSystem"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unit_system_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -541,17 +358,7 @@ impl HidReportItem { #[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 usage_maximum(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usageMaximum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_maximum_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -562,17 +369,7 @@ impl HidReportItem { #[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 usage_minimum(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usageMinimum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_minimum_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -583,14 +380,7 @@ impl HidReportItem { #[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 usages(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usages"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usages_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -601,13 +391,7 @@ impl HidReportItem { #[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 wrap(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("wrap"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.wrap_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs b/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs index c7f692f2cba..1052c037a47 100644 --- a/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs +++ b/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] pub type HiddenPluginEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &HiddenPluginEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &HiddenPluginEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &HiddenPluginEventInit, val: bool); } impl HiddenPluginEventInit { #[doc = "Construct a new `HiddenPluginEventInit`."] @@ -24,51 +30,21 @@ impl HiddenPluginEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HitRegionOptions.rs b/crates/web-sys/src/features/gen_HitRegionOptions.rs index 8a3a3aaee64..ebbfcefeb31 100644 --- a/crates/web-sys/src/features/gen_HitRegionOptions.rs +++ b/crates/web-sys/src/features/gen_HitRegionOptions.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"] pub type HitRegionOptions; + #[cfg(feature = "Element")] + #[wasm_bindgen(method, setter = "control")] + fn control_shim(this: &HitRegionOptions, val: Option<&Element>); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &HitRegionOptions, val: &str); + #[cfg(feature = "Path2d")] + #[wasm_bindgen(method, setter = "path")] + fn path_shim(this: &HitRegionOptions, val: Option<&Path2d>); } impl HitRegionOptions { #[doc = "Construct a new `HitRegionOptions`."] @@ -25,30 +33,14 @@ impl HitRegionOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `HitRegionOptions`*"] pub fn control(&mut self, val: Option<&Element>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("control"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.control_shim(val); self } #[doc = "Change the `id` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(feature = "Path2d")] @@ -56,13 +48,7 @@ impl HitRegionOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`, `Path2d`*"] pub fn path(&mut self, val: Option<&Path2d>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("path"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.path_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HkdfParams.rs b/crates/web-sys/src/features/gen_HkdfParams.rs index 3354ef77697..ba49af7229d 100644 --- a/crates/web-sys/src/features/gen_HkdfParams.rs +++ b/crates/web-sys/src/features/gen_HkdfParams.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] pub type HkdfParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &HkdfParams, val: &str); + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &HkdfParams, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "info")] + fn info_shim(this: &HkdfParams, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "salt")] + fn salt_shim(this: &HkdfParams, val: &::js_sys::Object); } impl HkdfParams { #[doc = "Construct a new `HkdfParams`."] @@ -33,52 +41,28 @@ impl HkdfParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `hash` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } #[doc = "Change the `info` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] pub fn info(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("info"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.info_shim(val); self } #[doc = "Change the `salt` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] pub fn salt(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("salt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.salt_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs b/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs index 49e33e0e5fd..dd912acbd23 100644 --- a/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs +++ b/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] pub type HmacDerivedKeyParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &HmacDerivedKeyParams, val: &str); + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &HmacDerivedKeyParams, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &HmacDerivedKeyParams, val: u32); } impl HmacDerivedKeyParams { #[doc = "Construct a new `HmacDerivedKeyParams`."] @@ -26,40 +32,21 @@ impl HmacDerivedKeyParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `hash` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] pub fn length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacImportParams.rs b/crates/web-sys/src/features/gen_HmacImportParams.rs index 750c2ae51a4..1fbc6013647 100644 --- a/crates/web-sys/src/features/gen_HmacImportParams.rs +++ b/crates/web-sys/src/features/gen_HmacImportParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] pub type HmacImportParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &HmacImportParams, val: &str); + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &HmacImportParams, val: &::wasm_bindgen::JsValue); } impl HmacImportParams { #[doc = "Construct a new `HmacImportParams`."] @@ -26,26 +30,14 @@ impl HmacImportParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `hash` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs b/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs index 86dcaeceab9..e45ef81f604 100644 --- a/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] pub type HmacKeyAlgorithm; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &HmacKeyAlgorithm, val: &str); + #[cfg(feature = "KeyAlgorithm")] + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &HmacKeyAlgorithm, val: &KeyAlgorithm); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &HmacKeyAlgorithm, val: u32); } impl HmacKeyAlgorithm { #[cfg(feature = "KeyAlgorithm")] @@ -28,13 +35,7 @@ impl HmacKeyAlgorithm { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(feature = "KeyAlgorithm")] @@ -42,27 +43,14 @@ impl HmacKeyAlgorithm { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"] pub fn hash(&mut self, val: &KeyAlgorithm) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] pub fn length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacKeyGenParams.rs b/crates/web-sys/src/features/gen_HmacKeyGenParams.rs index a443aa34283..0ccceb4973a 100644 --- a/crates/web-sys/src/features/gen_HmacKeyGenParams.rs +++ b/crates/web-sys/src/features/gen_HmacKeyGenParams.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] pub type HmacKeyGenParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &HmacKeyGenParams, val: &str); + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &HmacKeyGenParams, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &HmacKeyGenParams, val: u32); } impl HmacKeyGenParams { #[doc = "Construct a new `HmacKeyGenParams`."] @@ -26,40 +32,21 @@ impl HmacKeyGenParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `hash` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } #[doc = "Change the `length` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] pub fn length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HttpConnDict.rs b/crates/web-sys/src/features/gen_HttpConnDict.rs index 213a86caa21..04bbdd65a96 100644 --- a/crates/web-sys/src/features/gen_HttpConnDict.rs +++ b/crates/web-sys/src/features/gen_HttpConnDict.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnDict`*"] pub type HttpConnDict; + #[wasm_bindgen(method, setter = "connections")] + fn connections_shim(this: &HttpConnDict, val: &::wasm_bindgen::JsValue); } impl HttpConnDict { #[doc = "Construct a new `HttpConnDict`."] @@ -24,17 +26,7 @@ impl HttpConnDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnDict`*"] pub fn connections(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connections"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.connections_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HttpConnInfo.rs b/crates/web-sys/src/features/gen_HttpConnInfo.rs index d914956024b..42ec871b2b8 100644 --- a/crates/web-sys/src/features/gen_HttpConnInfo.rs +++ b/crates/web-sys/src/features/gen_HttpConnInfo.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] pub type HttpConnInfo; + #[wasm_bindgen(method, setter = "protocolVersion")] + fn protocol_version_shim(this: &HttpConnInfo, val: &str); + #[wasm_bindgen(method, setter = "rtt")] + fn rtt_shim(this: &HttpConnInfo, val: u32); + #[wasm_bindgen(method, setter = "ttl")] + fn ttl_shim(this: &HttpConnInfo, val: u32); } impl HttpConnInfo { #[doc = "Construct a new `HttpConnInfo`."] @@ -24,43 +30,21 @@ impl HttpConnInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] pub fn protocol_version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocolVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.protocol_version_shim(val); self } #[doc = "Change the `rtt` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] pub fn rtt(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rtt_shim(val); self } #[doc = "Change the `ttl` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] pub fn ttl(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ttl"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ttl_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_HttpConnectionElement.rs b/crates/web-sys/src/features/gen_HttpConnectionElement.rs index ecb934db52f..fe702139824 100644 --- a/crates/web-sys/src/features/gen_HttpConnectionElement.rs +++ b/crates/web-sys/src/features/gen_HttpConnectionElement.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub type HttpConnectionElement; + #[wasm_bindgen(method, setter = "active")] + fn active_shim(this: &HttpConnectionElement, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "halfOpens")] + fn half_opens_shim(this: &HttpConnectionElement, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "host")] + fn host_shim(this: &HttpConnectionElement, val: &str); + #[wasm_bindgen(method, setter = "idle")] + fn idle_shim(this: &HttpConnectionElement, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "port")] + fn port_shim(this: &HttpConnectionElement, val: u32); + #[wasm_bindgen(method, setter = "spdy")] + fn spdy_shim(this: &HttpConnectionElement, val: bool); + #[wasm_bindgen(method, setter = "ssl")] + fn ssl_shim(this: &HttpConnectionElement, val: bool); } impl HttpConnectionElement { #[doc = "Construct a new `HttpConnectionElement`."] @@ -24,96 +38,49 @@ impl HttpConnectionElement { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn active(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.active_shim(val); self } #[doc = "Change the `halfOpens` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn half_opens(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("halfOpens"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.half_opens_shim(val); self } #[doc = "Change the `host` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn host(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("host"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.host_shim(val); self } #[doc = "Change the `idle` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn idle(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("idle"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.idle_shim(val); self } #[doc = "Change the `port` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn port(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("port"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.port_shim(val); self } #[doc = "Change the `spdy` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn spdy(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("spdy"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.spdy_shim(val); self } #[doc = "Change the `ssl` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub fn ssl(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssl"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssl_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs b/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs index bbaeb942487..fabebd3008f 100644 --- a/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs +++ b/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] pub type IdbFileMetadataParameters; + #[wasm_bindgen(method, setter = "lastModified")] + fn last_modified_shim(this: &IdbFileMetadataParameters, val: bool); + #[wasm_bindgen(method, setter = "size")] + fn size_shim(this: &IdbFileMetadataParameters, val: bool); } impl IdbFileMetadataParameters { #[doc = "Construct a new `IdbFileMetadataParameters`."] @@ -24,30 +28,14 @@ impl IdbFileMetadataParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] pub fn last_modified(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastModified"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_modified_shim(val); self } #[doc = "Change the `size` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] pub fn size(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.size_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbIndexParameters.rs b/crates/web-sys/src/features/gen_IdbIndexParameters.rs index 2162121cfa8..b4ac9086a39 100644 --- a/crates/web-sys/src/features/gen_IdbIndexParameters.rs +++ b/crates/web-sys/src/features/gen_IdbIndexParameters.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] pub type IdbIndexParameters; + #[wasm_bindgen(method, setter = "locale")] + fn locale_shim(this: &IdbIndexParameters, val: Option<&str>); + #[wasm_bindgen(method, setter = "multiEntry")] + fn multi_entry_shim(this: &IdbIndexParameters, val: bool); + #[wasm_bindgen(method, setter = "unique")] + fn unique_shim(this: &IdbIndexParameters, val: bool); } impl IdbIndexParameters { #[doc = "Construct a new `IdbIndexParameters`."] @@ -24,45 +30,21 @@ impl IdbIndexParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] pub fn locale(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("locale"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.locale_shim(val); self } #[doc = "Change the `multiEntry` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] pub fn multi_entry(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multiEntry"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.multi_entry_shim(val); self } #[doc = "Change the `unique` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] pub fn unique(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("unique"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unique_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs b/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs index 71689ac147e..be0d078c977 100644 --- a/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs +++ b/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] pub type IdbObjectStoreParameters; + #[wasm_bindgen(method, setter = "autoIncrement")] + fn auto_increment_shim(this: &IdbObjectStoreParameters, val: bool); + #[wasm_bindgen(method, setter = "keyPath")] + fn key_path_shim(this: &IdbObjectStoreParameters, val: &::wasm_bindgen::JsValue); } impl IdbObjectStoreParameters { #[doc = "Construct a new `IdbObjectStoreParameters`."] @@ -24,34 +28,14 @@ impl IdbObjectStoreParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] pub fn auto_increment(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoIncrement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auto_increment_shim(val); self } #[doc = "Change the `keyPath` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] pub fn key_path(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyPath"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_path_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } } diff --git a/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs b/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs index 0a7caecc9f1..e5839a07b1c 100644 --- a/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs +++ b/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] pub type IdbOpenDbOptions; + #[cfg(feature = "StorageType")] + #[wasm_bindgen(method, setter = "storage")] + fn storage_shim(this: &IdbOpenDbOptions, val: StorageType); + #[wasm_bindgen(method, setter = "version")] + fn version_shim(this: &IdbOpenDbOptions, val: f64); } impl IdbOpenDbOptions { #[doc = "Construct a new `IdbOpenDbOptions`."] @@ -25,34 +30,14 @@ impl IdbOpenDbOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`, `StorageType`*"] pub fn storage(&mut self, val: StorageType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.storage_shim(val); self } #[doc = "Change the `version` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] pub fn version(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs b/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs index 8e2cdd7878a..65ae93c1d7e 100644 --- a/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub type IdbVersionChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &IdbVersionChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &IdbVersionChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &IdbVersionChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "newVersion")] + fn new_version_shim(this: &IdbVersionChangeEventInit, val: Option); + #[wasm_bindgen(method, setter = "oldVersion")] + fn old_version_shim(this: &IdbVersionChangeEventInit, val: f64); } impl IdbVersionChangeEventInit { #[doc = "Construct a new `IdbVersionChangeEventInit`."] @@ -24,85 +34,35 @@ impl IdbVersionChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `newVersion` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub fn new_version(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("newVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.new_version_shim(val); self } #[doc = "Change the `oldVersion` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub fn old_version(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("oldVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.old_version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IdleRequestOptions.rs b/crates/web-sys/src/features/gen_IdleRequestOptions.rs index 61dfe104384..b0b550ed8b4 100644 --- a/crates/web-sys/src/features/gen_IdleRequestOptions.rs +++ b/crates/web-sys/src/features/gen_IdleRequestOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdleRequestOptions`*"] pub type IdleRequestOptions; + #[wasm_bindgen(method, setter = "timeout")] + fn timeout_shim(this: &IdleRequestOptions, val: u32); } impl IdleRequestOptions { #[doc = "Construct a new `IdleRequestOptions`."] @@ -24,17 +26,7 @@ impl IdleRequestOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdleRequestOptions`*"] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timeout_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IirFilterOptions.rs b/crates/web-sys/src/features/gen_IirFilterOptions.rs index d21e80ccf4e..b88375ed03b 100644 --- a/crates/web-sys/src/features/gen_IirFilterOptions.rs +++ b/crates/web-sys/src/features/gen_IirFilterOptions.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] pub type IirFilterOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &IirFilterOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &IirFilterOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &IirFilterOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "feedback")] + fn feedback_shim(this: &IirFilterOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "feedforward")] + fn feedforward_shim(this: &IirFilterOptions, val: &::wasm_bindgen::JsValue); } impl IirFilterOptions { #[doc = "Construct a new `IirFilterOptions`."] @@ -26,17 +38,7 @@ impl IirFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -44,17 +46,7 @@ impl IirFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `IirFilterOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -62,51 +54,21 @@ impl IirFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `IirFilterOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `feedback` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] pub fn feedback(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("feedback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.feedback_shim(val); self } #[doc = "Change the `feedforward` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] pub fn feedforward(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("feedforward"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.feedforward_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageBitmapOptions.rs b/crates/web-sys/src/features/gen_ImageBitmapOptions.rs index bda518acf21..865c2786fd3 100644 --- a/crates/web-sys/src/features/gen_ImageBitmapOptions.rs +++ b/crates/web-sys/src/features/gen_ImageBitmapOptions.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] pub type ImageBitmapOptions; + #[cfg(feature = "ColorSpaceConversion")] + #[wasm_bindgen(method, setter = "colorSpaceConversion")] + fn color_space_conversion_shim(this: &ImageBitmapOptions, val: ColorSpaceConversion); + #[cfg(feature = "ImageOrientation")] + #[wasm_bindgen(method, setter = "imageOrientation")] + fn image_orientation_shim(this: &ImageBitmapOptions, val: ImageOrientation); + #[cfg(feature = "PremultiplyAlpha")] + #[wasm_bindgen(method, setter = "premultiplyAlpha")] + fn premultiply_alpha_shim(this: &ImageBitmapOptions, val: PremultiplyAlpha); + #[wasm_bindgen(method, setter = "resizeHeight")] + fn resize_height_shim(this: &ImageBitmapOptions, val: u32); + #[cfg(feature = "ResizeQuality")] + #[wasm_bindgen(method, setter = "resizeQuality")] + fn resize_quality_shim(this: &ImageBitmapOptions, val: ResizeQuality); + #[wasm_bindgen(method, setter = "resizeWidth")] + fn resize_width_shim(this: &ImageBitmapOptions, val: u32); } impl ImageBitmapOptions { #[doc = "Construct a new `ImageBitmapOptions`."] @@ -25,17 +41,7 @@ impl ImageBitmapOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageBitmapOptions`*"] pub fn color_space_conversion(&mut self, val: ColorSpaceConversion) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpaceConversion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_space_conversion_shim(val); self } #[cfg(feature = "ImageOrientation")] @@ -43,17 +49,7 @@ impl ImageBitmapOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageOrientation`*"] pub fn image_orientation(&mut self, val: ImageOrientation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("imageOrientation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.image_orientation_shim(val); self } #[cfg(feature = "PremultiplyAlpha")] @@ -61,34 +57,14 @@ impl ImageBitmapOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `PremultiplyAlpha`*"] pub fn premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultiplyAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.premultiply_alpha_shim(val); self } #[doc = "Change the `resizeHeight` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] pub fn resize_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resizeHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.resize_height_shim(val); self } #[cfg(feature = "ResizeQuality")] @@ -96,34 +72,14 @@ impl ImageBitmapOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ResizeQuality`*"] pub fn resize_quality(&mut self, val: ResizeQuality) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resizeQuality"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.resize_quality_shim(val); self } #[doc = "Change the `resizeWidth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] pub fn resize_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resizeWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.resize_width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs b/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs index b7299dc4149..093b78e3c67 100644 --- a/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] pub type ImageCaptureErrorEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ImageCaptureErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ImageCaptureErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ImageCaptureErrorEventInit, val: bool); + #[cfg(feature = "ImageCaptureError")] + #[wasm_bindgen(method, setter = "imageCaptureError")] + fn image_capture_error_shim(this: &ImageCaptureErrorEventInit, val: Option<&ImageCaptureError>); } impl ImageCaptureErrorEventInit { #[doc = "Construct a new `ImageCaptureErrorEventInit`."] @@ -24,51 +33,21 @@ impl ImageCaptureErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "ImageCaptureError")] @@ -76,17 +55,7 @@ impl ImageCaptureErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureError`, `ImageCaptureErrorEventInit`*"] pub fn image_capture_error(&mut self, val: Option<&ImageCaptureError>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("imageCaptureError"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.image_capture_error_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageDecodeOptions.rs b/crates/web-sys/src/features/gen_ImageDecodeOptions.rs index b19a2ff5e60..35fae56cd7b 100644 --- a/crates/web-sys/src/features/gen_ImageDecodeOptions.rs +++ b/crates/web-sys/src/features/gen_ImageDecodeOptions.rs @@ -14,6 +14,10 @@ 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 type ImageDecodeOptions; + #[wasm_bindgen(method, setter = "completeFramesOnly")] + fn complete_frames_only_shim(this: &ImageDecodeOptions, val: bool); + #[wasm_bindgen(method, setter = "frameIndex")] + fn frame_index_shim(this: &ImageDecodeOptions, val: u32); } #[cfg(web_sys_unstable_apis)] impl ImageDecodeOptions { @@ -36,17 +40,7 @@ impl ImageDecodeOptions { #[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 complete_frames_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("completeFramesOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.complete_frames_only_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +51,7 @@ impl ImageDecodeOptions { #[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 frame_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_index_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageDecodeResult.rs b/crates/web-sys/src/features/gen_ImageDecodeResult.rs index deccede5ab1..056f4f15364 100644 --- a/crates/web-sys/src/features/gen_ImageDecodeResult.rs +++ b/crates/web-sys/src/features/gen_ImageDecodeResult.rs @@ -14,6 +14,11 @@ 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 type ImageDecodeResult; + #[wasm_bindgen(method, setter = "complete")] + fn complete_shim(this: &ImageDecodeResult, val: bool); + #[cfg(feature = "VideoFrame")] + #[wasm_bindgen(method, setter = "image")] + fn image_shim(this: &ImageDecodeResult, val: &VideoFrame); } #[cfg(web_sys_unstable_apis)] impl ImageDecodeResult { @@ -39,17 +44,7 @@ impl ImageDecodeResult { #[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 complete(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("complete"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.complete_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -61,13 +56,7 @@ impl ImageDecodeResult { #[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 image(&mut self, val: &VideoFrame) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("image"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.image_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageDecoderInit.rs b/crates/web-sys/src/features/gen_ImageDecoderInit.rs index 165473031b8..416e83d64a3 100644 --- a/crates/web-sys/src/features/gen_ImageDecoderInit.rs +++ b/crates/web-sys/src/features/gen_ImageDecoderInit.rs @@ -14,6 +14,22 @@ 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 type ImageDecoderInit; + #[cfg(feature = "ColorSpaceConversion")] + #[wasm_bindgen(method, setter = "colorSpaceConversion")] + fn color_space_conversion_shim(this: &ImageDecoderInit, val: ColorSpaceConversion); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &ImageDecoderInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "desiredHeight")] + fn desired_height_shim(this: &ImageDecoderInit, val: u32); + #[wasm_bindgen(method, setter = "desiredWidth")] + fn desired_width_shim(this: &ImageDecoderInit, val: u32); + #[wasm_bindgen(method, setter = "preferAnimation")] + fn prefer_animation_shim(this: &ImageDecoderInit, val: bool); + #[cfg(feature = "PremultiplyAlpha")] + #[wasm_bindgen(method, setter = "premultiplyAlpha")] + fn premultiply_alpha_shim(this: &ImageDecoderInit, val: PremultiplyAlpha); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &ImageDecoderInit, val: &str); } #[cfg(web_sys_unstable_apis)] impl ImageDecoderInit { @@ -39,17 +55,7 @@ impl ImageDecoderInit { #[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 color_space_conversion(&mut self, val: ColorSpaceConversion) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpaceConversion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_space_conversion_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,13 +66,7 @@ impl ImageDecoderInit { #[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 data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +77,7 @@ impl ImageDecoderInit { #[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_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("desiredHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.desired_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -98,17 +88,7 @@ impl ImageDecoderInit { #[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_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("desiredWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.desired_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -119,17 +99,7 @@ impl ImageDecoderInit { #[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 prefer_animation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preferAnimation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prefer_animation_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -141,17 +111,7 @@ impl ImageDecoderInit { #[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 premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultiplyAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.premultiply_alpha_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -162,13 +122,7 @@ impl ImageDecoderInit { #[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 type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageEncodeOptions.rs b/crates/web-sys/src/features/gen_ImageEncodeOptions.rs index d3b492287d3..da0a6b82565 100644 --- a/crates/web-sys/src/features/gen_ImageEncodeOptions.rs +++ b/crates/web-sys/src/features/gen_ImageEncodeOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] pub type ImageEncodeOptions; + #[wasm_bindgen(method, setter = "quality")] + fn quality_shim(this: &ImageEncodeOptions, val: f64); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &ImageEncodeOptions, val: &str); } impl ImageEncodeOptions { #[doc = "Construct a new `ImageEncodeOptions`."] @@ -24,30 +28,14 @@ impl ImageEncodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] pub fn quality(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("quality"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.quality_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_InputEventInit.rs b/crates/web-sys/src/features/gen_InputEventInit.rs index 58790f2b346..2b79bf4c57a 100644 --- a/crates/web-sys/src/features/gen_InputEventInit.rs +++ b/crates/web-sys/src/features/gen_InputEventInit.rs @@ -10,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub type InputEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &InputEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &InputEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &InputEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &InputEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &InputEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &InputEventInit, val: Option<&str>); + #[cfg(feature = "DataTransfer")] + #[wasm_bindgen(method, setter = "dataTransfer")] + fn data_transfer_shim(this: &InputEventInit, val: Option<&DataTransfer>); + #[wasm_bindgen(method, setter = "inputType")] + fn input_type_shim(this: &InputEventInit, val: &str); + #[wasm_bindgen(method, setter = "isComposing")] + fn is_composing_shim(this: &InputEventInit, val: bool); + #[wasm_bindgen(method, setter = "targetRanges")] + fn target_ranges_shim(this: &InputEventInit, val: &::wasm_bindgen::JsValue); } impl InputEventInit { #[doc = "Construct a new `InputEventInit`."] @@ -24,65 +46,28 @@ impl InputEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,26 +75,14 @@ impl InputEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn data(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(feature = "DataTransfer")] @@ -117,68 +90,28 @@ impl InputEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `InputEventInit`*"] pub fn data_transfer(&mut self, val: Option<&DataTransfer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataTransfer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_transfer_shim(val); self } #[doc = "Change the `inputType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn input_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inputType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.input_type_shim(val); self } #[doc = "Change the `isComposing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn is_composing(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isComposing"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_composing_shim(val); self } #[doc = "Change the `targetRanges` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub fn target_ranges(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targetRanges"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.target_ranges_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs b/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs index b1f228792e4..caa9de343c9 100644 --- a/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs +++ b/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"] pub type IntersectionObserverEntryInit; + #[cfg(feature = "DomRectInit")] + #[wasm_bindgen(method, setter = "boundingClientRect")] + fn bounding_client_rect_shim(this: &IntersectionObserverEntryInit, val: &DomRectInit); + #[cfg(feature = "DomRectInit")] + #[wasm_bindgen(method, setter = "intersectionRect")] + fn intersection_rect_shim(this: &IntersectionObserverEntryInit, val: &DomRectInit); + #[cfg(feature = "DomRectInit")] + #[wasm_bindgen(method, setter = "rootBounds")] + fn root_bounds_shim(this: &IntersectionObserverEntryInit, val: &DomRectInit); + #[cfg(feature = "Element")] + #[wasm_bindgen(method, setter = "target")] + fn target_shim(this: &IntersectionObserverEntryInit, val: &Element); + #[wasm_bindgen(method, setter = "time")] + fn time_shim(this: &IntersectionObserverEntryInit, val: f64); } impl IntersectionObserverEntryInit { #[cfg(all(feature = "DomRectInit", feature = "Element",))] @@ -37,17 +51,7 @@ impl IntersectionObserverEntryInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] pub fn bounding_client_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("boundingClientRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bounding_client_rect_shim(val); self } #[cfg(feature = "DomRectInit")] @@ -55,17 +59,7 @@ impl IntersectionObserverEntryInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] pub fn intersection_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("intersectionRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.intersection_rect_shim(val); self } #[cfg(feature = "DomRectInit")] @@ -73,17 +67,7 @@ impl IntersectionObserverEntryInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] pub fn root_bounds(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rootBounds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.root_bounds_shim(val); self } #[cfg(feature = "Element")] @@ -91,27 +75,14 @@ impl IntersectionObserverEntryInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverEntryInit`*"] pub fn target(&mut self, val: &Element) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("target"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.target_shim(val); self } #[doc = "Change the `time` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"] pub fn time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("time"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IntersectionObserverInit.rs b/crates/web-sys/src/features/gen_IntersectionObserverInit.rs index b861cc013d3..13c7411b698 100644 --- a/crates/web-sys/src/features/gen_IntersectionObserverInit.rs +++ b/crates/web-sys/src/features/gen_IntersectionObserverInit.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] pub type IntersectionObserverInit; + #[cfg(feature = "Element")] + #[wasm_bindgen(method, setter = "root")] + fn root_shim(this: &IntersectionObserverInit, val: Option<&Element>); + #[wasm_bindgen(method, setter = "rootMargin")] + fn root_margin_shim(this: &IntersectionObserverInit, val: &str); + #[wasm_bindgen(method, setter = "threshold")] + fn threshold_shim(this: &IntersectionObserverInit, val: &::wasm_bindgen::JsValue); } impl IntersectionObserverInit { #[doc = "Construct a new `IntersectionObserverInit`."] @@ -25,47 +32,21 @@ impl IntersectionObserverInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverInit`*"] pub fn root(&mut self, val: Option<&Element>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("root"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.root_shim(val); self } #[doc = "Change the `rootMargin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] pub fn root_margin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rootMargin"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.root_margin_shim(val); self } #[doc = "Change the `threshold` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] pub fn threshold(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("threshold"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.threshold_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IsInputPendingOptions.rs b/crates/web-sys/src/features/gen_IsInputPendingOptions.rs index 9820eb88b0f..2aba174f2da 100644 --- a/crates/web-sys/src/features/gen_IsInputPendingOptions.rs +++ b/crates/web-sys/src/features/gen_IsInputPendingOptions.rs @@ -14,6 +14,8 @@ 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 type IsInputPendingOptions; + #[wasm_bindgen(method, setter = "includeContinuous")] + fn include_continuous_shim(this: &IsInputPendingOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl IsInputPendingOptions { @@ -36,17 +38,7 @@ impl IsInputPendingOptions { #[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 include_continuous(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("includeContinuous"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.include_continuous_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs b/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs index 03fb25fc633..85b0c3497f9 100644 --- a/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs +++ b/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] pub type IterableKeyAndValueResult; + #[wasm_bindgen(method, setter = "done")] + fn done_shim(this: &IterableKeyAndValueResult, val: bool); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &IterableKeyAndValueResult, val: &::wasm_bindgen::JsValue); } impl IterableKeyAndValueResult { #[doc = "Construct a new `IterableKeyAndValueResult`."] @@ -24,26 +28,14 @@ impl IterableKeyAndValueResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] 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.done_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] 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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs b/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs index eb0862894f6..7e76fde4bea 100644 --- a/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs +++ b/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] pub type IterableKeyOrValueResult; + #[wasm_bindgen(method, setter = "done")] + fn done_shim(this: &IterableKeyOrValueResult, val: bool); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &IterableKeyOrValueResult, val: &::wasm_bindgen::JsValue); } impl IterableKeyOrValueResult { #[doc = "Construct a new `IterableKeyOrValueResult`."] @@ -24,26 +28,14 @@ impl IterableKeyOrValueResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] 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.done_shim(val); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] 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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_JsonWebKey.rs b/crates/web-sys/src/features/gen_JsonWebKey.rs index ac0a1d172e6..04e6cfb11a0 100644 --- a/crates/web-sys/src/features/gen_JsonWebKey.rs +++ b/crates/web-sys/src/features/gen_JsonWebKey.rs @@ -10,6 +10,42 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub type JsonWebKey; + #[wasm_bindgen(method, setter = "alg")] + fn alg_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "crv")] + fn crv_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "d")] + fn d_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "dp")] + fn dp_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "dq")] + fn dq_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "e")] + fn e_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "ext")] + fn ext_shim(this: &JsonWebKey, val: bool); + #[wasm_bindgen(method, setter = "k")] + fn k_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "key_ops")] + fn key_ops_shim(this: &JsonWebKey, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "kty")] + fn kty_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "n")] + fn n_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "oth")] + fn oth_shim(this: &JsonWebKey, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "p")] + fn p_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "q")] + fn q_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "qi")] + fn qi_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "use")] + fn use__shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &JsonWebKey, val: &str); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &JsonWebKey, val: &str); } impl JsonWebKey { #[doc = "Construct a new `JsonWebKey`."] @@ -25,238 +61,126 @@ impl JsonWebKey { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn alg(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alg"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alg_shim(val); self } #[doc = "Change the `crv` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn crv(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("crv"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.crv_shim(val); self } #[doc = "Change the `d` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn d(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.d_shim(val); self } #[doc = "Change the `dp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn dp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dp_shim(val); self } #[doc = "Change the `dq` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn dq(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dq"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dq_shim(val); self } #[doc = "Change the `e` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn e(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("e"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.e_shim(val); self } #[doc = "Change the `ext` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn ext(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ext"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ext_shim(val); self } #[doc = "Change the `k` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn k(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("k"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.k_shim(val); self } #[doc = "Change the `key_ops` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn key_ops(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("key_ops"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_ops_shim(val); self } #[doc = "Change the `kty` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn kty(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("kty"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.kty_shim(val); self } #[doc = "Change the `n` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn n(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("n"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.n_shim(val); self } #[doc = "Change the `oth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn oth(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("oth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.oth_shim(val); self } #[doc = "Change the `p` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn p(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p_shim(val); self } #[doc = "Change the `q` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn q(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("q"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.q_shim(val); self } #[doc = "Change the `qi` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn qi(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("qi"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.qi_shim(val); self } #[doc = "Change the `use` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn use_(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("use"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.use__shim(val); self } #[doc = "Change the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn x(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[doc = "Change the `y` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub fn y(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyAlgorithm.rs b/crates/web-sys/src/features/gen_KeyAlgorithm.rs index ba180ae7d1f..101595bb222 100644 --- a/crates/web-sys/src/features/gen_KeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_KeyAlgorithm.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyAlgorithm`*"] pub type KeyAlgorithm; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &KeyAlgorithm, val: &str); } impl KeyAlgorithm { #[doc = "Construct a new `KeyAlgorithm`."] @@ -25,13 +27,7 @@ impl KeyAlgorithm { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyAlgorithm`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyIdsInitData.rs b/crates/web-sys/src/features/gen_KeyIdsInitData.rs index 5076c6835e4..1f4d7767a4a 100644 --- a/crates/web-sys/src/features/gen_KeyIdsInitData.rs +++ b/crates/web-sys/src/features/gen_KeyIdsInitData.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyIdsInitData`*"] pub type KeyIdsInitData; + #[wasm_bindgen(method, setter = "kids")] + fn kids_shim(this: &KeyIdsInitData, val: &::wasm_bindgen::JsValue); } impl KeyIdsInitData { #[doc = "Construct a new `KeyIdsInitData`."] @@ -25,13 +27,7 @@ impl KeyIdsInitData { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyIdsInitData`*"] pub fn kids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("kids"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.kids_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyboardEventInit.rs b/crates/web-sys/src/features/gen_KeyboardEventInit.rs index f09608394a6..3d777d4d7fb 100644 --- a/crates/web-sys/src/features/gen_KeyboardEventInit.rs +++ b/crates/web-sys/src/features/gen_KeyboardEventInit.rs @@ -10,6 +10,59 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub type KeyboardEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &KeyboardEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &KeyboardEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "charCode")] + fn char_code_shim(this: &KeyboardEventInit, val: u32); + #[wasm_bindgen(method, setter = "code")] + fn code_shim(this: &KeyboardEventInit, val: &str); + #[wasm_bindgen(method, setter = "isComposing")] + fn is_composing_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "key")] + fn key_shim(this: &KeyboardEventInit, val: &str); + #[wasm_bindgen(method, setter = "keyCode")] + fn key_code_shim(this: &KeyboardEventInit, val: u32); + #[wasm_bindgen(method, setter = "location")] + fn location_shim(this: &KeyboardEventInit, val: u32); + #[wasm_bindgen(method, setter = "repeat")] + fn repeat_shim(this: &KeyboardEventInit, val: bool); + #[wasm_bindgen(method, setter = "which")] + fn which_shim(this: &KeyboardEventInit, val: u32); } impl KeyboardEventInit { #[doc = "Construct a new `KeyboardEventInit`."] @@ -24,65 +77,28 @@ impl KeyboardEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,352 +106,154 @@ impl KeyboardEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } #[doc = "Change the `charCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn char_code(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.char_code_shim(val); self } #[doc = "Change the `code` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn code(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.code_shim(val); self } #[doc = "Change the `isComposing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn is_composing(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isComposing"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_composing_shim(val); self } #[doc = "Change the `key` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn key(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("key"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_shim(val); self } #[doc = "Change the `keyCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn key_code(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_code_shim(val); self } #[doc = "Change the `location` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn location(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("location"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.location_shim(val); self } #[doc = "Change the `repeat` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn repeat(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("repeat"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.repeat_shim(val); self } #[doc = "Change the `which` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub fn which(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("which"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.which_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs b/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs index 430b5e5865d..7685c6af482 100644 --- a/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs +++ b/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs @@ -14,6 +14,35 @@ 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 type KeyframeAnimationOptions; + #[wasm_bindgen(method, setter = "delay")] + fn delay_shim(this: &KeyframeAnimationOptions, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &KeyframeAnimationOptions, val: PlaybackDirection); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &KeyframeAnimationOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &KeyframeAnimationOptions, val: &str); + #[wasm_bindgen(method, setter = "endDelay")] + fn end_delay_shim(this: &KeyframeAnimationOptions, val: f64); + #[cfg(feature = "FillMode")] + #[wasm_bindgen(method, setter = "fill")] + fn fill_shim(this: &KeyframeAnimationOptions, val: FillMode); + #[wasm_bindgen(method, setter = "iterationStart")] + fn iteration_start_shim(this: &KeyframeAnimationOptions, val: f64); + #[wasm_bindgen(method, setter = "iterations")] + fn iterations_shim(this: &KeyframeAnimationOptions, val: f64); + #[cfg(feature = "CompositeOperation")] + #[wasm_bindgen(method, setter = "composite")] + fn composite_shim(this: &KeyframeAnimationOptions, val: CompositeOperation); + #[cfg(feature = "IterationCompositeOperation")] + #[wasm_bindgen(method, setter = "iterationComposite")] + fn iteration_composite_shim(this: &KeyframeAnimationOptions, val: IterationCompositeOperation); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &KeyframeAnimationOptions, val: &str); + #[cfg(feature = "AnimationTimeline")] + #[wasm_bindgen(method, setter = "timeline")] + fn timeline_shim(this: &KeyframeAnimationOptions, val: Option<&AnimationTimeline>); } #[cfg(web_sys_unstable_apis)] impl KeyframeAnimationOptions { @@ -36,13 +65,7 @@ impl KeyframeAnimationOptions { #[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 delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +77,7 @@ impl KeyframeAnimationOptions { #[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 direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +88,7 @@ impl KeyframeAnimationOptions { #[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 duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -96,14 +99,7 @@ impl KeyframeAnimationOptions { #[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 easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -114,17 +110,7 @@ impl KeyframeAnimationOptions { #[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 end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_delay_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -136,13 +122,7 @@ impl KeyframeAnimationOptions { #[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 fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fill_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -153,17 +133,7 @@ impl KeyframeAnimationOptions { #[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 iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_start_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -174,17 +144,7 @@ impl KeyframeAnimationOptions { #[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 iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iterations_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -196,17 +156,7 @@ impl KeyframeAnimationOptions { #[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 composite(&mut self, val: CompositeOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composite_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -218,17 +168,7 @@ impl KeyframeAnimationOptions { #[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 iteration_composite(&mut self, val: IterationCompositeOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationComposite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_composite_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -239,13 +179,7 @@ impl KeyframeAnimationOptions { #[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 id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -257,17 +191,7 @@ impl KeyframeAnimationOptions { #[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 timeline(&mut self, val: Option<&AnimationTimeline>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeline"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timeline_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs b/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs index 222ba75f32f..94c35ecedd4 100644 --- a/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs +++ b/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs @@ -10,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub type KeyframeEffectOptions; + #[wasm_bindgen(method, setter = "delay")] + fn delay_shim(this: &KeyframeEffectOptions, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &KeyframeEffectOptions, val: PlaybackDirection); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &KeyframeEffectOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &KeyframeEffectOptions, val: &str); + #[wasm_bindgen(method, setter = "endDelay")] + fn end_delay_shim(this: &KeyframeEffectOptions, val: f64); + #[cfg(feature = "FillMode")] + #[wasm_bindgen(method, setter = "fill")] + fn fill_shim(this: &KeyframeEffectOptions, val: FillMode); + #[wasm_bindgen(method, setter = "iterationStart")] + fn iteration_start_shim(this: &KeyframeEffectOptions, val: f64); + #[wasm_bindgen(method, setter = "iterations")] + fn iterations_shim(this: &KeyframeEffectOptions, val: f64); + #[cfg(feature = "CompositeOperation")] + #[wasm_bindgen(method, setter = "composite")] + fn composite_shim(this: &KeyframeEffectOptions, val: CompositeOperation); + #[cfg(feature = "IterationCompositeOperation")] + #[wasm_bindgen(method, setter = "iterationComposite")] + fn iteration_composite_shim(this: &KeyframeEffectOptions, val: IterationCompositeOperation); } impl KeyframeEffectOptions { #[doc = "Construct a new `KeyframeEffectOptions`."] @@ -24,13 +48,7 @@ impl KeyframeEffectOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_shim(val); self } #[cfg(feature = "PlaybackDirection")] @@ -38,65 +56,28 @@ impl KeyframeEffectOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`, `PlaybackDirection`*"] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[doc = "Change the `duration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `endDelay` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_delay_shim(val); self } #[cfg(feature = "FillMode")] @@ -104,47 +85,21 @@ impl KeyframeEffectOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FillMode`, `KeyframeEffectOptions`*"] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fill_shim(val); self } #[doc = "Change the `iterationStart` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_start_shim(val); self } #[doc = "Change the `iterations` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iterations_shim(val); self } #[cfg(feature = "CompositeOperation")] @@ -152,17 +107,7 @@ impl KeyframeEffectOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeEffectOptions`*"] pub fn composite(&mut self, val: CompositeOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composite_shim(val); self } #[cfg(feature = "IterationCompositeOperation")] @@ -170,17 +115,7 @@ impl KeyframeEffectOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeEffectOptions`*"] pub fn iteration_composite(&mut self, val: IterationCompositeOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationComposite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_composite_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_L10nElement.rs b/crates/web-sys/src/features/gen_L10nElement.rs index 63b38292768..0fd76d28bc7 100644 --- a/crates/web-sys/src/features/gen_L10nElement.rs +++ b/crates/web-sys/src/features/gen_L10nElement.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub type L10nElement; + #[wasm_bindgen(method, setter = "l10nArgs")] + fn l10n_args_shim(this: &L10nElement, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "l10nAttrs")] + fn l10n_attrs_shim(this: &L10nElement, val: Option<&str>); + #[wasm_bindgen(method, setter = "l10nId")] + fn l10n_id_shim(this: &L10nElement, val: &str); + #[wasm_bindgen(method, setter = "localName")] + fn local_name_shim(this: &L10nElement, val: &str); + #[wasm_bindgen(method, setter = "namespaceURI")] + fn namespace_uri_shim(this: &L10nElement, val: &str); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &L10nElement, val: Option<&str>); } impl L10nElement { #[doc = "Construct a new `L10nElement`."] @@ -27,95 +39,42 @@ impl L10nElement { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub fn l10n_args(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("l10nArgs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.l10n_args_shim(val); self } #[doc = "Change the `l10nAttrs` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub fn l10n_attrs(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("l10nAttrs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.l10n_attrs_shim(val); self } #[doc = "Change the `l10nId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub fn l10n_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("l10nId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.l10n_id_shim(val); self } #[doc = "Change the `localName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub fn local_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.local_name_shim(val); self } #[doc = "Change the `namespaceURI` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub fn namespace_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namespaceURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.namespace_uri_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub fn type_(&mut self, val: Option<&str>) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_L10nValue.rs b/crates/web-sys/src/features/gen_L10nValue.rs index e5dc9f315f2..0dbf073485f 100644 --- a/crates/web-sys/src/features/gen_L10nValue.rs +++ b/crates/web-sys/src/features/gen_L10nValue.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] pub type L10nValue; + #[wasm_bindgen(method, setter = "attributes")] + fn attributes_shim(this: &L10nValue, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &L10nValue, val: Option<&str>); } impl L10nValue { #[doc = "Construct a new `L10nValue`."] @@ -24,30 +28,14 @@ impl L10nValue { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] pub fn attributes(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attributes_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } #[doc = "Change the `value` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] pub fn value(&mut self, val: Option<&str>) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_LifecycleCallbacks.rs b/crates/web-sys/src/features/gen_LifecycleCallbacks.rs index c6ce99e144e..82522003c88 100644 --- a/crates/web-sys/src/features/gen_LifecycleCallbacks.rs +++ b/crates/web-sys/src/features/gen_LifecycleCallbacks.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] pub type LifecycleCallbacks; + #[wasm_bindgen(method, setter = "adoptedCallback")] + fn adopted_callback_shim(this: &LifecycleCallbacks, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "attributeChangedCallback")] + fn attribute_changed_callback_shim(this: &LifecycleCallbacks, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "connectedCallback")] + fn connected_callback_shim(this: &LifecycleCallbacks, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "disconnectedCallback")] + fn disconnected_callback_shim(this: &LifecycleCallbacks, val: &::js_sys::Function); } impl LifecycleCallbacks { #[doc = "Construct a new `LifecycleCallbacks`."] @@ -24,68 +32,28 @@ impl LifecycleCallbacks { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] pub fn adopted_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("adoptedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.adopted_callback_shim(val); self } #[doc = "Change the `attributeChangedCallback` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] pub fn attribute_changed_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeChangedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attribute_changed_callback_shim(val); self } #[doc = "Change the `connectedCallback` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] pub fn connected_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connectedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.connected_callback_shim(val); self } #[doc = "Change the `disconnectedCallback` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] pub fn disconnected_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disconnectedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.disconnected_callback_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_LocaleInfo.rs b/crates/web-sys/src/features/gen_LocaleInfo.rs index f6debf39470..ba79aa77e67 100644 --- a/crates/web-sys/src/features/gen_LocaleInfo.rs +++ b/crates/web-sys/src/features/gen_LocaleInfo.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] pub type LocaleInfo; + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &LocaleInfo, val: &str); + #[wasm_bindgen(method, setter = "locale")] + fn locale_shim(this: &LocaleInfo, val: &str); } impl LocaleInfo { #[doc = "Construct a new `LocaleInfo`."] @@ -24,31 +28,14 @@ impl LocaleInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] pub fn direction(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[doc = "Change the `locale` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] pub fn locale(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("locale"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.locale_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_LockInfo.rs b/crates/web-sys/src/features/gen_LockInfo.rs index d9ea0f7ec87..0c7112ddc24 100644 --- a/crates/web-sys/src/features/gen_LockInfo.rs +++ b/crates/web-sys/src/features/gen_LockInfo.rs @@ -14,6 +14,13 @@ 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 type LockInfo; + #[wasm_bindgen(method, setter = "clientId")] + fn client_id_shim(this: &LockInfo, val: &str); + #[cfg(feature = "LockMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &LockInfo, val: LockMode); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &LockInfo, val: &str); } #[cfg(web_sys_unstable_apis)] impl LockInfo { @@ -36,17 +43,7 @@ impl LockInfo { #[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 client_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,13 +55,7 @@ impl LockInfo { #[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 mode(&mut self, val: LockMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,13 +66,7 @@ impl LockInfo { #[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 name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_LockManagerSnapshot.rs b/crates/web-sys/src/features/gen_LockManagerSnapshot.rs index 87d1eed1670..a6b6ed20ddc 100644 --- a/crates/web-sys/src/features/gen_LockManagerSnapshot.rs +++ b/crates/web-sys/src/features/gen_LockManagerSnapshot.rs @@ -14,6 +14,10 @@ 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 type LockManagerSnapshot; + #[wasm_bindgen(method, setter = "held")] + fn held_shim(this: &LockManagerSnapshot, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "pending")] + fn pending_shim(this: &LockManagerSnapshot, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl LockManagerSnapshot { @@ -36,13 +40,7 @@ impl LockManagerSnapshot { #[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 held(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("held"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.held_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,17 +51,7 @@ impl LockManagerSnapshot { #[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 pending(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pending"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pending_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_LockOptions.rs b/crates/web-sys/src/features/gen_LockOptions.rs index 27131f050d3..8b450d2645c 100644 --- a/crates/web-sys/src/features/gen_LockOptions.rs +++ b/crates/web-sys/src/features/gen_LockOptions.rs @@ -14,6 +14,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 type LockOptions; + #[wasm_bindgen(method, setter = "ifAvailable")] + fn if_available_shim(this: &LockOptions, val: bool); + #[cfg(feature = "LockMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &LockOptions, val: LockMode); + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &LockOptions, val: &AbortSignal); + #[wasm_bindgen(method, setter = "steal")] + fn steal_shim(this: &LockOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl LockOptions { @@ -36,17 +46,7 @@ impl LockOptions { #[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 if_available(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ifAvailable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.if_available_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,13 +58,7 @@ impl LockOptions { #[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 mode(&mut self, val: LockMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,14 +70,7 @@ impl LockOptions { #[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 signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -94,13 +81,7 @@ impl LockOptions { #[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 steal(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("steal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.steal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaConfiguration.rs b/crates/web-sys/src/features/gen_MediaConfiguration.rs index 0f1170f28fc..5214880c65c 100644 --- a/crates/web-sys/src/features/gen_MediaConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaConfiguration.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaConfiguration`*"] pub type MediaConfiguration; + #[cfg(feature = "AudioConfiguration")] + #[wasm_bindgen(method, setter = "audio")] + fn audio_shim(this: &MediaConfiguration, val: &AudioConfiguration); + #[cfg(feature = "VideoConfiguration")] + #[wasm_bindgen(method, setter = "video")] + fn video_shim(this: &MediaConfiguration, val: &VideoConfiguration); } impl MediaConfiguration { #[doc = "Construct a new `MediaConfiguration`."] @@ -25,13 +31,7 @@ impl MediaConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaConfiguration`*"] pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_shim(val); self } #[cfg(feature = "VideoConfiguration")] @@ -39,13 +39,7 @@ impl MediaConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaConfiguration`, `VideoConfiguration`*"] pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs b/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs index ffa9292dec5..056b56bda30 100644 --- a/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`*"] pub type MediaDecodingConfiguration; + #[cfg(feature = "AudioConfiguration")] + #[wasm_bindgen(method, setter = "audio")] + fn audio_shim(this: &MediaDecodingConfiguration, val: &AudioConfiguration); + #[cfg(feature = "VideoConfiguration")] + #[wasm_bindgen(method, setter = "video")] + fn video_shim(this: &MediaDecodingConfiguration, val: &VideoConfiguration); + #[cfg(feature = "MediaDecodingType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &MediaDecodingConfiguration, val: MediaDecodingType); } impl MediaDecodingConfiguration { #[cfg(feature = "MediaDecodingType")] @@ -27,13 +36,7 @@ impl MediaDecodingConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"] pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_shim(val); self } #[cfg(feature = "VideoConfiguration")] @@ -41,13 +44,7 @@ impl MediaDecodingConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"] pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_shim(val); self } #[cfg(feature = "MediaDecodingType")] @@ -55,13 +52,7 @@ impl MediaDecodingConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"] pub fn type_(&mut self, val: MediaDecodingType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs b/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs index 8a8bb78ab40..c13381b70d2 100644 --- a/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs +++ b/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaElementAudioSourceOptions`*"] pub type MediaElementAudioSourceOptions; + #[cfg(feature = "HtmlMediaElement")] + #[wasm_bindgen(method, setter = "mediaElement")] + fn media_element_shim(this: &MediaElementAudioSourceOptions, val: &HtmlMediaElement); } impl MediaElementAudioSourceOptions { #[cfg(feature = "HtmlMediaElement")] @@ -27,17 +30,7 @@ impl MediaElementAudioSourceOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"] pub fn media_element(&mut self, val: &HtmlMediaElement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaElement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_element_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs b/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs index d08e4ef3b6f..eafa1733fc4 100644 --- a/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`*"] pub type MediaEncodingConfiguration; + #[cfg(feature = "AudioConfiguration")] + #[wasm_bindgen(method, setter = "audio")] + fn audio_shim(this: &MediaEncodingConfiguration, val: &AudioConfiguration); + #[cfg(feature = "VideoConfiguration")] + #[wasm_bindgen(method, setter = "video")] + fn video_shim(this: &MediaEncodingConfiguration, val: &VideoConfiguration); + #[cfg(feature = "MediaEncodingType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &MediaEncodingConfiguration, val: MediaEncodingType); } impl MediaEncodingConfiguration { #[cfg(feature = "MediaEncodingType")] @@ -27,13 +36,7 @@ impl MediaEncodingConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaEncodingConfiguration`*"] pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_shim(val); self } #[cfg(feature = "VideoConfiguration")] @@ -41,13 +44,7 @@ impl MediaEncodingConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `VideoConfiguration`*"] pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_shim(val); self } #[cfg(feature = "MediaEncodingType")] @@ -55,13 +52,7 @@ impl MediaEncodingConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `MediaEncodingType`*"] pub fn type_(&mut self, val: MediaEncodingType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaImage.rs b/crates/web-sys/src/features/gen_MediaImage.rs index 2eb3a955cb9..779f4419ecb 100644 --- a/crates/web-sys/src/features/gen_MediaImage.rs +++ b/crates/web-sys/src/features/gen_MediaImage.rs @@ -14,6 +14,12 @@ 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 type MediaImage; + #[wasm_bindgen(method, setter = "sizes")] + fn sizes_shim(this: &MediaImage, val: &str); + #[wasm_bindgen(method, setter = "src")] + fn src_shim(this: &MediaImage, val: &str); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &MediaImage, val: &str); } #[cfg(web_sys_unstable_apis)] impl MediaImage { @@ -37,13 +43,7 @@ impl MediaImage { #[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 sizes(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sizes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sizes_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,13 +54,7 @@ impl MediaImage { #[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 src(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("src"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.src_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -71,13 +65,7 @@ impl MediaImage { #[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 type_(&mut self, val: &str) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs b/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs index 9e48fad217d..b5d349fa116 100644 --- a/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] pub type MediaKeyMessageEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MediaKeyMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MediaKeyMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MediaKeyMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "message")] + fn message_shim(this: &MediaKeyMessageEventInit, val: &::js_sys::ArrayBuffer); + #[cfg(feature = "MediaKeyMessageType")] + #[wasm_bindgen(method, setter = "messageType")] + fn message_type_shim(this: &MediaKeyMessageEventInit, val: MediaKeyMessageType); } impl MediaKeyMessageEventInit { #[cfg(feature = "MediaKeyMessageType")] @@ -27,68 +38,28 @@ impl MediaKeyMessageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `message` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] pub fn message(&mut self, val: &::js_sys::ArrayBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_shim(val); self } #[cfg(feature = "MediaKeyMessageType")] @@ -96,17 +67,7 @@ impl MediaKeyMessageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`, `MediaKeyMessageType`*"] pub fn message_type(&mut self, val: MediaKeyMessageType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("messageType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_type_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs b/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs index 96041fcbb25..f723838a4c8 100644 --- a/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub type MediaKeyNeededEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MediaKeyNeededEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MediaKeyNeededEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MediaKeyNeededEventInit, val: bool); + #[wasm_bindgen(method, setter = "initData")] + fn init_data_shim(this: &MediaKeyNeededEventInit, val: Option<&::js_sys::ArrayBuffer>); + #[wasm_bindgen(method, setter = "initDataType")] + fn init_data_type_shim(this: &MediaKeyNeededEventInit, val: &str); } impl MediaKeyNeededEventInit { #[doc = "Construct a new `MediaKeyNeededEventInit`."] @@ -24,85 +34,35 @@ impl MediaKeyNeededEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `initData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub fn init_data(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.init_data_shim(val); self } #[doc = "Change the `initDataType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub fn init_data_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initDataType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.init_data_type_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs b/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs index 2491b941a97..189ffb73a60 100644 --- a/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub type MediaKeySystemConfiguration; + #[wasm_bindgen(method, setter = "audioCapabilities")] + fn audio_capabilities_shim(this: &MediaKeySystemConfiguration, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "MediaKeysRequirement")] + #[wasm_bindgen(method, setter = "distinctiveIdentifier")] + fn distinctive_identifier_shim(this: &MediaKeySystemConfiguration, val: MediaKeysRequirement); + #[wasm_bindgen(method, setter = "initDataTypes")] + fn init_data_types_shim(this: &MediaKeySystemConfiguration, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &MediaKeySystemConfiguration, val: &str); + #[cfg(feature = "MediaKeysRequirement")] + #[wasm_bindgen(method, setter = "persistentState")] + fn persistent_state_shim(this: &MediaKeySystemConfiguration, val: MediaKeysRequirement); + #[wasm_bindgen(method, setter = "sessionTypes")] + fn session_types_shim(this: &MediaKeySystemConfiguration, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "videoCapabilities")] + fn video_capabilities_shim(this: &MediaKeySystemConfiguration, val: &::wasm_bindgen::JsValue); } impl MediaKeySystemConfiguration { #[doc = "Construct a new `MediaKeySystemConfiguration`."] @@ -24,17 +40,7 @@ impl MediaKeySystemConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub fn audio_capabilities(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioCapabilities"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_capabilities_shim(val); self } #[cfg(feature = "MediaKeysRequirement")] @@ -42,47 +48,21 @@ impl MediaKeySystemConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] pub fn distinctive_identifier(&mut self, val: MediaKeysRequirement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("distinctiveIdentifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.distinctive_identifier_shim(val); self } #[doc = "Change the `initDataTypes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub fn init_data_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initDataTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.init_data_types_shim(val); self } #[doc = "Change the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } #[cfg(feature = "MediaKeysRequirement")] @@ -90,51 +70,21 @@ impl MediaKeySystemConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] pub fn persistent_state(&mut self, val: MediaKeysRequirement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("persistentState"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.persistent_state_shim(val); self } #[doc = "Change the `sessionTypes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub fn session_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sessionTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.session_types_shim(val); self } #[doc = "Change the `videoCapabilities` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub fn video_capabilities(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("videoCapabilities"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_capabilities_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs b/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs index fab91188935..6d4e840e0fb 100644 --- a/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs +++ b/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] pub type MediaKeySystemMediaCapability; + #[wasm_bindgen(method, setter = "contentType")] + fn content_type_shim(this: &MediaKeySystemMediaCapability, val: &str); + #[wasm_bindgen(method, setter = "robustness")] + fn robustness_shim(this: &MediaKeySystemMediaCapability, val: &str); } impl MediaKeySystemMediaCapability { #[doc = "Construct a new `MediaKeySystemMediaCapability`."] @@ -24,34 +28,14 @@ impl MediaKeySystemMediaCapability { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] pub fn content_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contentType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.content_type_shim(val); self } #[doc = "Change the `robustness` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] pub fn robustness(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("robustness"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.robustness_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeysPolicy.rs b/crates/web-sys/src/features/gen_MediaKeysPolicy.rs index 079ed456788..de6f010e296 100644 --- a/crates/web-sys/src/features/gen_MediaKeysPolicy.rs +++ b/crates/web-sys/src/features/gen_MediaKeysPolicy.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeysPolicy`*"] pub type MediaKeysPolicy; + #[wasm_bindgen(method, setter = "minHdcpVersion")] + fn min_hdcp_version_shim(this: &MediaKeysPolicy, val: &str); } impl MediaKeysPolicy { #[doc = "Construct a new `MediaKeysPolicy`."] @@ -24,17 +26,7 @@ impl MediaKeysPolicy { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeysPolicy`*"] pub fn min_hdcp_version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minHdcpVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_hdcp_version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaMetadataInit.rs b/crates/web-sys/src/features/gen_MediaMetadataInit.rs index 7ec33aa1467..91fb637fb19 100644 --- a/crates/web-sys/src/features/gen_MediaMetadataInit.rs +++ b/crates/web-sys/src/features/gen_MediaMetadataInit.rs @@ -14,6 +14,14 @@ 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 type MediaMetadataInit; + #[wasm_bindgen(method, setter = "album")] + fn album_shim(this: &MediaMetadataInit, val: &str); + #[wasm_bindgen(method, setter = "artist")] + fn artist_shim(this: &MediaMetadataInit, val: &str); + #[wasm_bindgen(method, setter = "artwork")] + fn artwork_shim(this: &MediaMetadataInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "title")] + fn title_shim(this: &MediaMetadataInit, val: &str); } #[cfg(web_sys_unstable_apis)] impl MediaMetadataInit { @@ -36,13 +44,7 @@ impl MediaMetadataInit { #[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 album(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("album"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.album_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,14 +55,7 @@ impl MediaMetadataInit { #[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 artist(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("artist"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.artist_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -71,17 +66,7 @@ impl MediaMetadataInit { #[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 artwork(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("artwork"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.artwork_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -92,13 +77,7 @@ impl MediaMetadataInit { #[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 title(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("title"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.title_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaPositionState.rs b/crates/web-sys/src/features/gen_MediaPositionState.rs index b8ac6fa5f9b..2cb0437b6cd 100644 --- a/crates/web-sys/src/features/gen_MediaPositionState.rs +++ b/crates/web-sys/src/features/gen_MediaPositionState.rs @@ -14,6 +14,12 @@ 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 type MediaPositionState; + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &MediaPositionState, val: f64); + #[wasm_bindgen(method, setter = "playbackRate")] + fn playback_rate_shim(this: &MediaPositionState, val: f64); + #[wasm_bindgen(method, setter = "position")] + fn position_shim(this: &MediaPositionState, val: f64); } #[cfg(web_sys_unstable_apis)] impl MediaPositionState { @@ -36,17 +42,7 @@ impl MediaPositionState { #[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 duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +53,7 @@ impl MediaPositionState { #[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 playback_rate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("playbackRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.playback_rate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +64,7 @@ impl MediaPositionState { #[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 position(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("position"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.position_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs b/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs index b792f8ec247..842841ed7d9 100644 --- a/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub type MediaQueryListEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MediaQueryListEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MediaQueryListEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MediaQueryListEventInit, val: bool); + #[wasm_bindgen(method, setter = "matches")] + fn matches_shim(this: &MediaQueryListEventInit, val: bool); + #[wasm_bindgen(method, setter = "media")] + fn media_shim(this: &MediaQueryListEventInit, val: &str); } impl MediaQueryListEventInit { #[doc = "Construct a new `MediaQueryListEventInit`."] @@ -24,81 +34,35 @@ impl MediaQueryListEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `matches` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub fn matches(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("matches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.matches_shim(val); self } #[doc = "Change the `media` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub fn media(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("media"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs b/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs index 41ca06922ec..bd0cee69550 100644 --- a/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] pub type MediaRecorderErrorEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MediaRecorderErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MediaRecorderErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MediaRecorderErrorEventInit, val: bool); + #[cfg(feature = "DomException")] + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &MediaRecorderErrorEventInit, val: &DomException); } impl MediaRecorderErrorEventInit { #[cfg(feature = "DomException")] @@ -26,51 +35,21 @@ impl MediaRecorderErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "DomException")] @@ -78,13 +57,7 @@ impl MediaRecorderErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomException`, `MediaRecorderErrorEventInit`*"] pub fn error(&mut self, val: &DomException) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaRecorderOptions.rs b/crates/web-sys/src/features/gen_MediaRecorderOptions.rs index 8a5fc951d7a..c2b2d199293 100644 --- a/crates/web-sys/src/features/gen_MediaRecorderOptions.rs +++ b/crates/web-sys/src/features/gen_MediaRecorderOptions.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub type MediaRecorderOptions; + #[wasm_bindgen(method, setter = "audioBitsPerSecond")] + fn audio_bits_per_second_shim(this: &MediaRecorderOptions, val: u32); + #[wasm_bindgen(method, setter = "bitsPerSecond")] + fn bits_per_second_shim(this: &MediaRecorderOptions, val: u32); + #[wasm_bindgen(method, setter = "mimeType")] + fn mime_type_shim(this: &MediaRecorderOptions, val: &str); + #[wasm_bindgen(method, setter = "videoBitsPerSecond")] + fn video_bits_per_second_shim(this: &MediaRecorderOptions, val: u32); } impl MediaRecorderOptions { #[doc = "Construct a new `MediaRecorderOptions`."] @@ -24,68 +32,28 @@ impl MediaRecorderOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub fn audio_bits_per_second(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioBitsPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_bits_per_second_shim(val); self } #[doc = "Change the `bitsPerSecond` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub fn bits_per_second(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitsPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bits_per_second_shim(val); self } #[doc = "Change the `mimeType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub fn mime_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mime_type_shim(val); self } #[doc = "Change the `videoBitsPerSecond` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub fn video_bits_per_second(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("videoBitsPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_bits_per_second_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs b/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs index a9803decfa1..45cde7e9664 100644 --- a/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs +++ b/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs @@ -14,6 +14,15 @@ 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 type MediaSessionActionDetails; + #[cfg(feature = "MediaSessionAction")] + #[wasm_bindgen(method, setter = "action")] + fn action_shim(this: &MediaSessionActionDetails, val: MediaSessionAction); + #[wasm_bindgen(method, setter = "fastSeek")] + fn fast_seek_shim(this: &MediaSessionActionDetails, val: Option); + #[wasm_bindgen(method, setter = "seekOffset")] + fn seek_offset_shim(this: &MediaSessionActionDetails, val: Option); + #[wasm_bindgen(method, setter = "seekTime")] + fn seek_time_shim(this: &MediaSessionActionDetails, val: Option); } #[cfg(web_sys_unstable_apis)] impl MediaSessionActionDetails { @@ -39,14 +48,7 @@ impl MediaSessionActionDetails { #[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 action(&mut self, val: MediaSessionAction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("action"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.action_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +59,7 @@ impl MediaSessionActionDetails { #[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 fast_seek(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fastSeek"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fast_seek_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +70,7 @@ impl MediaSessionActionDetails { #[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 seek_offset(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("seekOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.seek_offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +81,7 @@ impl MediaSessionActionDetails { #[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 seek_time(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("seekTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.seek_time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs b/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs index 215d5e0049b..633826b3f34 100644 --- a/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs +++ b/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamAudioSourceOptions`*"] pub type MediaStreamAudioSourceOptions; + #[cfg(feature = "MediaStream")] + #[wasm_bindgen(method, setter = "mediaStream")] + fn media_stream_shim(this: &MediaStreamAudioSourceOptions, val: &MediaStream); } impl MediaStreamAudioSourceOptions { #[cfg(feature = "MediaStream")] @@ -27,17 +30,7 @@ impl MediaStreamAudioSourceOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamAudioSourceOptions`*"] pub fn media_stream(&mut self, val: &MediaStream) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaStream"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_stream_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamConstraints.rs b/crates/web-sys/src/features/gen_MediaStreamConstraints.rs index ef0d435e3d2..9533a444d03 100644 --- a/crates/web-sys/src/features/gen_MediaStreamConstraints.rs +++ b/crates/web-sys/src/features/gen_MediaStreamConstraints.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub type MediaStreamConstraints; + #[wasm_bindgen(method, setter = "audio")] + fn audio_shim(this: &MediaStreamConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "fake")] + fn fake_shim(this: &MediaStreamConstraints, val: bool); + #[wasm_bindgen(method, setter = "peerIdentity")] + fn peer_identity_shim(this: &MediaStreamConstraints, val: Option<&str>); + #[wasm_bindgen(method, setter = "picture")] + fn picture_shim(this: &MediaStreamConstraints, val: bool); + #[wasm_bindgen(method, setter = "video")] + fn video_shim(this: &MediaStreamConstraints, val: &::wasm_bindgen::JsValue); } impl MediaStreamConstraints { #[doc = "Construct a new `MediaStreamConstraints`."] @@ -24,73 +34,35 @@ impl MediaStreamConstraints { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub fn audio(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_shim(val); self } #[doc = "Change the `fake` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub fn fake(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fake"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fake_shim(val); self } #[doc = "Change the `peerIdentity` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub fn peer_identity(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("peerIdentity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.peer_identity_shim(val); self } #[doc = "Change the `picture` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub fn picture(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("picture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.picture_shim(val); self } #[doc = "Change the `video` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub fn video(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.video_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamEventInit.rs b/crates/web-sys/src/features/gen_MediaStreamEventInit.rs index ee276698f7f..82458dfd60c 100644 --- a/crates/web-sys/src/features/gen_MediaStreamEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaStreamEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] pub type MediaStreamEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MediaStreamEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MediaStreamEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MediaStreamEventInit, val: bool); + #[cfg(feature = "MediaStream")] + #[wasm_bindgen(method, setter = "stream")] + fn stream_shim(this: &MediaStreamEventInit, val: Option<&MediaStream>); } impl MediaStreamEventInit { #[doc = "Construct a new `MediaStreamEventInit`."] @@ -24,51 +33,21 @@ impl MediaStreamEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "MediaStream")] @@ -76,14 +55,7 @@ impl MediaStreamEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamEventInit`*"] pub fn stream(&mut self, val: Option<&MediaStream>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stream"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stream_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs b/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs index 6f0d79afc89..d66b918fe20 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] pub type MediaStreamTrackEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MediaStreamTrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MediaStreamTrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MediaStreamTrackEventInit, val: bool); + #[cfg(feature = "MediaStreamTrack")] + #[wasm_bindgen(method, setter = "track")] + fn track_shim(this: &MediaStreamTrackEventInit, val: &MediaStreamTrack); } impl MediaStreamTrackEventInit { #[cfg(feature = "MediaStreamTrack")] @@ -26,51 +35,21 @@ impl MediaStreamTrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "MediaStreamTrack")] @@ -78,13 +57,7 @@ impl MediaStreamTrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackEventInit`*"] pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.track_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs b/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs index 752f668854b..a85a9268d57 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs @@ -14,6 +14,8 @@ 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 type MediaStreamTrackGeneratorInit; + #[wasm_bindgen(method, setter = "kind")] + fn kind_shim(this: &MediaStreamTrackGeneratorInit, val: &str); } #[cfg(web_sys_unstable_apis)] impl MediaStreamTrackGeneratorInit { @@ -37,13 +39,7 @@ impl MediaStreamTrackGeneratorInit { #[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 kind(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("kind"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.kind_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs b/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs index bbf2078e8bc..fabbd4a7418 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs @@ -14,6 +14,11 @@ 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 type MediaStreamTrackProcessorInit; + #[wasm_bindgen(method, setter = "maxBufferSize")] + fn max_buffer_size_shim(this: &MediaStreamTrackProcessorInit, val: u16); + #[cfg(feature = "MediaStreamTrack")] + #[wasm_bindgen(method, setter = "track")] + fn track_shim(this: &MediaStreamTrackProcessorInit, val: &MediaStreamTrack); } #[cfg(web_sys_unstable_apis)] impl MediaStreamTrackProcessorInit { @@ -38,17 +43,7 @@ impl MediaStreamTrackProcessorInit { #[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 max_buffer_size(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxBufferSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_buffer_size_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,13 +55,7 @@ impl MediaStreamTrackProcessorInit { #[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 track(&mut self, val: &MediaStreamTrack) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.track_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs b/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs index 3c5212071b0..866fad34359 100644 --- a/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs +++ b/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs @@ -10,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub type MediaTrackConstraintSet; + #[wasm_bindgen(method, setter = "autoGainControl")] + fn auto_gain_control_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "browserWindow")] + fn browser_window_shim(this: &MediaTrackConstraintSet, val: f64); + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "deviceId")] + fn device_id_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "echoCancellation")] + fn echo_cancellation_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "facingMode")] + fn facing_mode_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "frameRate")] + fn frame_rate_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "mediaSource")] + fn media_source_shim(this: &MediaTrackConstraintSet, val: &str); + #[wasm_bindgen(method, setter = "noiseSuppression")] + fn noise_suppression_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "scrollWithPage")] + fn scroll_with_page_shim(this: &MediaTrackConstraintSet, val: bool); + #[wasm_bindgen(method, setter = "viewportHeight")] + fn viewport_height_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "viewportOffsetX")] + fn viewport_offset_x_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "viewportOffsetY")] + fn viewport_offset_y_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "viewportWidth")] + fn viewport_width_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); } impl MediaTrackConstraintSet { #[doc = "Construct a new `MediaTrackConstraintSet`."] @@ -24,265 +56,112 @@ impl MediaTrackConstraintSet { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auto_gain_control_shim(val); self } #[doc = "Change the `browserWindow` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn browser_window(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("browserWindow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.browser_window_shim(val); self } #[doc = "Change the `channelCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn channel_count(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[doc = "Change the `deviceId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn device_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_id_shim(val); self } #[doc = "Change the `echoCancellation` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.echo_cancellation_shim(val); self } #[doc = "Change the `facingMode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.facing_mode_shim(val); self } #[doc = "Change the `frameRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn frame_rate(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_rate_shim(val); self } #[doc = "Change the `height` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `mediaSource` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn media_source(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_source_shim(val); self } #[doc = "Change the `noiseSuppression` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.noise_suppression_shim(val); self } #[doc = "Change the `scrollWithPage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn scroll_with_page(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scrollWithPage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scroll_with_page_shim(val); self } #[doc = "Change the `viewportHeight` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn viewport_height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_height_shim(val); self } #[doc = "Change the `viewportOffsetX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn viewport_offset_x(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_offset_x_shim(val); self } #[doc = "Change the `viewportOffsetY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn viewport_offset_y(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_offset_y_shim(val); self } #[doc = "Change the `viewportWidth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn viewport_width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_width_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub fn width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackConstraints.rs b/crates/web-sys/src/features/gen_MediaTrackConstraints.rs index dbd4cfd9af5..8b89c26eef7 100644 --- a/crates/web-sys/src/features/gen_MediaTrackConstraints.rs +++ b/crates/web-sys/src/features/gen_MediaTrackConstraints.rs @@ -10,6 +10,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub type MediaTrackConstraints; + #[wasm_bindgen(method, setter = "autoGainControl")] + fn auto_gain_control_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "browserWindow")] + fn browser_window_shim(this: &MediaTrackConstraints, val: f64); + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "deviceId")] + fn device_id_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "echoCancellation")] + fn echo_cancellation_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "facingMode")] + fn facing_mode_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "frameRate")] + fn frame_rate_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "mediaSource")] + fn media_source_shim(this: &MediaTrackConstraints, val: &str); + #[wasm_bindgen(method, setter = "noiseSuppression")] + fn noise_suppression_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "scrollWithPage")] + fn scroll_with_page_shim(this: &MediaTrackConstraints, val: bool); + #[wasm_bindgen(method, setter = "viewportHeight")] + fn viewport_height_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "viewportOffsetX")] + fn viewport_offset_x_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "viewportOffsetY")] + fn viewport_offset_y_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "viewportWidth")] + fn viewport_width_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "advanced")] + fn advanced_shim(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); } impl MediaTrackConstraints { #[doc = "Construct a new `MediaTrackConstraints`."] @@ -24,282 +58,119 @@ impl MediaTrackConstraints { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auto_gain_control_shim(val); self } #[doc = "Change the `browserWindow` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn browser_window(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("browserWindow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.browser_window_shim(val); self } #[doc = "Change the `channelCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn channel_count(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[doc = "Change the `deviceId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn device_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_id_shim(val); self } #[doc = "Change the `echoCancellation` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.echo_cancellation_shim(val); self } #[doc = "Change the `facingMode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.facing_mode_shim(val); self } #[doc = "Change the `frameRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn frame_rate(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_rate_shim(val); self } #[doc = "Change the `height` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `mediaSource` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn media_source(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_source_shim(val); self } #[doc = "Change the `noiseSuppression` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.noise_suppression_shim(val); self } #[doc = "Change the `scrollWithPage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn scroll_with_page(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scrollWithPage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scroll_with_page_shim(val); self } #[doc = "Change the `viewportHeight` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn viewport_height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_height_shim(val); self } #[doc = "Change the `viewportOffsetX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn viewport_offset_x(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_offset_x_shim(val); self } #[doc = "Change the `viewportOffsetY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn viewport_offset_y(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_offset_y_shim(val); self } #[doc = "Change the `viewportWidth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn viewport_width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.viewport_width_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } #[doc = "Change the `advanced` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub fn advanced(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("advanced"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.advanced_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackSettings.rs b/crates/web-sys/src/features/gen_MediaTrackSettings.rs index 6a4493dccb2..3bd4e245aac 100644 --- a/crates/web-sys/src/features/gen_MediaTrackSettings.rs +++ b/crates/web-sys/src/features/gen_MediaTrackSettings.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub type MediaTrackSettings; + #[wasm_bindgen(method, setter = "autoGainControl")] + fn auto_gain_control_shim(this: &MediaTrackSettings, val: bool); + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &MediaTrackSettings, val: i32); + #[wasm_bindgen(method, setter = "deviceId")] + fn device_id_shim(this: &MediaTrackSettings, val: &str); + #[wasm_bindgen(method, setter = "echoCancellation")] + fn echo_cancellation_shim(this: &MediaTrackSettings, val: bool); + #[wasm_bindgen(method, setter = "facingMode")] + fn facing_mode_shim(this: &MediaTrackSettings, val: &str); + #[wasm_bindgen(method, setter = "frameRate")] + fn frame_rate_shim(this: &MediaTrackSettings, val: f64); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &MediaTrackSettings, val: i32); + #[wasm_bindgen(method, setter = "noiseSuppression")] + fn noise_suppression_shim(this: &MediaTrackSettings, val: bool); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &MediaTrackSettings, val: i32); } impl MediaTrackSettings { #[doc = "Construct a new `MediaTrackSettings`."] @@ -24,146 +42,63 @@ impl MediaTrackSettings { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn auto_gain_control(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auto_gain_control_shim(val); self } #[doc = "Change the `channelCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn channel_count(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[doc = "Change the `deviceId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn device_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_id_shim(val); self } #[doc = "Change the `echoCancellation` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn echo_cancellation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.echo_cancellation_shim(val); self } #[doc = "Change the `facingMode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn facing_mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.facing_mode_shim(val); self } #[doc = "Change the `frameRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn frame_rate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_rate_shim(val); self } #[doc = "Change the `height` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `noiseSuppression` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn noise_suppression(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.noise_suppression_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs b/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs index aa47b5f0218..1cf7fc77567 100644 --- a/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs +++ b/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs @@ -10,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub type MediaTrackSupportedConstraints; + #[wasm_bindgen(method, setter = "aspectRatio")] + fn aspect_ratio_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "autoGainControl")] + fn auto_gain_control_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "deviceId")] + fn device_id_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "echoCancellation")] + fn echo_cancellation_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "facingMode")] + fn facing_mode_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "frameRate")] + fn frame_rate_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "groupId")] + fn group_id_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "latency")] + fn latency_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "noiseSuppression")] + fn noise_suppression_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "sampleSize")] + fn sample_size_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "volume")] + fn volume_shim(this: &MediaTrackSupportedConstraints, val: bool); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &MediaTrackSupportedConstraints, val: bool); } impl MediaTrackSupportedConstraints { #[doc = "Construct a new `MediaTrackSupportedConstraints`."] @@ -24,245 +54,105 @@ impl MediaTrackSupportedConstraints { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn aspect_ratio(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("aspectRatio"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.aspect_ratio_shim(val); self } #[doc = "Change the `autoGainControl` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn auto_gain_control(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auto_gain_control_shim(val); self } #[doc = "Change the `channelCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn channel_count(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[doc = "Change the `deviceId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn device_id(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_id_shim(val); self } #[doc = "Change the `echoCancellation` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn echo_cancellation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.echo_cancellation_shim(val); self } #[doc = "Change the `facingMode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn facing_mode(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.facing_mode_shim(val); self } #[doc = "Change the `frameRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn frame_rate(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_rate_shim(val); self } #[doc = "Change the `groupId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn group_id(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("groupId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.group_id_shim(val); self } #[doc = "Change the `height` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn height(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `latency` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn latency(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("latency"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.latency_shim(val); self } #[doc = "Change the `noiseSuppression` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn noise_suppression(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.noise_suppression_shim(val); self } #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn sample_rate(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } #[doc = "Change the `sampleSize` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn sample_size(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_size_shim(val); self } #[doc = "Change the `volume` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn volume(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("volume"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.volume_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub fn width(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MemoryAttribution.rs b/crates/web-sys/src/features/gen_MemoryAttribution.rs index 16d6c70567f..9fdedda1113 100644 --- a/crates/web-sys/src/features/gen_MemoryAttribution.rs +++ b/crates/web-sys/src/features/gen_MemoryAttribution.rs @@ -14,6 +14,13 @@ 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 type MemoryAttribution; + #[cfg(feature = "MemoryAttributionContainer")] + #[wasm_bindgen(method, setter = "container")] + fn container_shim(this: &MemoryAttribution, val: &MemoryAttributionContainer); + #[wasm_bindgen(method, setter = "scope")] + fn scope_shim(this: &MemoryAttribution, val: &str); + #[wasm_bindgen(method, setter = "url")] + fn url_shim(this: &MemoryAttribution, val: &str); } #[cfg(web_sys_unstable_apis)] impl MemoryAttribution { @@ -37,17 +44,7 @@ impl MemoryAttribution { #[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 container(&mut self, val: &MemoryAttributionContainer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("container"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.container_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,13 +55,7 @@ impl MemoryAttribution { #[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 scope(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("scope"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scope_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,13 +66,7 @@ impl MemoryAttribution { #[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 url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.url_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs b/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs index 7365be8b9fe..0dfe8ce12ea 100644 --- a/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs +++ b/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs @@ -14,6 +14,10 @@ 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 type MemoryAttributionContainer; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &MemoryAttributionContainer, val: &str); + #[wasm_bindgen(method, setter = "src")] + fn src_shim(this: &MemoryAttributionContainer, val: &str); } #[cfg(web_sys_unstable_apis)] impl MemoryAttributionContainer { @@ -36,13 +40,7 @@ impl MemoryAttributionContainer { #[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 id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,13 +51,7 @@ impl MemoryAttributionContainer { #[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 src(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("src"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.src_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs b/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs index 0588e44af03..05592cc877c 100644 --- a/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs +++ b/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs @@ -14,6 +14,12 @@ 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 type MemoryBreakdownEntry; + #[wasm_bindgen(method, setter = "attribution")] + fn attribution_shim(this: &MemoryBreakdownEntry, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "bytes")] + fn bytes_shim(this: &MemoryBreakdownEntry, val: f64); + #[wasm_bindgen(method, setter = "types")] + fn types_shim(this: &MemoryBreakdownEntry, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl MemoryBreakdownEntry { @@ -36,17 +42,7 @@ impl MemoryBreakdownEntry { #[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 attribution(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attribution"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attribution_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +53,7 @@ impl MemoryBreakdownEntry { #[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 bytes(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("bytes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,13 +64,7 @@ impl MemoryBreakdownEntry { #[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 types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("types"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.types_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MemoryMeasurement.rs b/crates/web-sys/src/features/gen_MemoryMeasurement.rs index db9b2b695cc..b3bbfaca883 100644 --- a/crates/web-sys/src/features/gen_MemoryMeasurement.rs +++ b/crates/web-sys/src/features/gen_MemoryMeasurement.rs @@ -14,6 +14,10 @@ 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 type MemoryMeasurement; + #[wasm_bindgen(method, setter = "breakdown")] + fn breakdown_shim(this: &MemoryMeasurement, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "bytes")] + fn bytes_shim(this: &MemoryMeasurement, val: f64); } #[cfg(web_sys_unstable_apis)] impl MemoryMeasurement { @@ -36,17 +40,7 @@ impl MemoryMeasurement { #[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 breakdown(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("breakdown"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.breakdown_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +51,7 @@ impl MemoryMeasurement { #[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 bytes(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("bytes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MessageEventInit.rs b/crates/web-sys/src/features/gen_MessageEventInit.rs index 2a098bee6dd..0e5381f8cc9 100644 --- a/crates/web-sys/src/features/gen_MessageEventInit.rs +++ b/crates/web-sys/src/features/gen_MessageEventInit.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub type MessageEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &MessageEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "lastEventId")] + fn last_event_id_shim(this: &MessageEventInit, val: &str); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &MessageEventInit, val: &str); + #[wasm_bindgen(method, setter = "ports")] + fn ports_shim(this: &MessageEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &MessageEventInit, val: Option<&::js_sys::Object>); } impl MessageEventInit { #[doc = "Construct a new `MessageEventInit`."] @@ -24,122 +40,56 @@ impl MessageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[doc = "Change the `lastEventId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn last_event_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastEventId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_event_id_shim(val); self } #[doc = "Change the `origin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[doc = "Change the `ports` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ports"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ports_shim(val); self } #[doc = "Change the `source` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs b/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs index 125b7476de2..77e2f4b71df 100644 --- a/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs +++ b/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] pub type MidiConnectionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MidiConnectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MidiConnectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MidiConnectionEventInit, val: bool); + #[cfg(feature = "MidiPort")] + #[wasm_bindgen(method, setter = "port")] + fn port_shim(this: &MidiConnectionEventInit, val: Option<&MidiPort>); } impl MidiConnectionEventInit { #[doc = "Construct a new `MidiConnectionEventInit`."] @@ -24,51 +33,21 @@ impl MidiConnectionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "MidiPort")] @@ -76,13 +55,7 @@ impl MidiConnectionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`, `MidiPort`*"] pub fn port(&mut self, val: Option<&MidiPort>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("port"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.port_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MidiMessageEventInit.rs b/crates/web-sys/src/features/gen_MidiMessageEventInit.rs index 4002e71c68e..da581fa01f1 100644 --- a/crates/web-sys/src/features/gen_MidiMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_MidiMessageEventInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] pub type MidiMessageEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MidiMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MidiMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MidiMessageEventInit, val: bool); } impl MidiMessageEventInit { #[doc = "Construct a new `MidiMessageEventInit`."] @@ -24,51 +30,21 @@ impl MidiMessageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MidiOptions.rs b/crates/web-sys/src/features/gen_MidiOptions.rs index 482e5427c57..bb9a50ece05 100644 --- a/crates/web-sys/src/features/gen_MidiOptions.rs +++ b/crates/web-sys/src/features/gen_MidiOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] pub type MidiOptions; + #[wasm_bindgen(method, setter = "software")] + fn software_shim(this: &MidiOptions, val: bool); + #[wasm_bindgen(method, setter = "sysex")] + fn sysex_shim(this: &MidiOptions, val: bool); } impl MidiOptions { #[doc = "Construct a new `MidiOptions`."] @@ -24,30 +28,14 @@ impl MidiOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] pub fn software(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("software"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.software_shim(val); self } #[doc = "Change the `sysex` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] pub fn sysex(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sysex"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sysex_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MouseEventInit.rs b/crates/web-sys/src/features/gen_MouseEventInit.rs index 61c5bb518c1..340e3bddebd 100644 --- a/crates/web-sys/src/features/gen_MouseEventInit.rs +++ b/crates/web-sys/src/features/gen_MouseEventInit.rs @@ -10,6 +10,62 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub type MouseEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &MouseEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &MouseEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &MouseEventInit, val: bool); + #[wasm_bindgen(method, setter = "button")] + fn button_shim(this: &MouseEventInit, val: i16); + #[wasm_bindgen(method, setter = "buttons")] + fn buttons_shim(this: &MouseEventInit, val: u16); + #[wasm_bindgen(method, setter = "clientX")] + fn client_x_shim(this: &MouseEventInit, val: i32); + #[wasm_bindgen(method, setter = "clientY")] + fn client_y_shim(this: &MouseEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementX")] + fn movement_x_shim(this: &MouseEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementY")] + fn movement_y_shim(this: &MouseEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[wasm_bindgen(method, setter = "relatedTarget")] + fn related_target_shim(this: &MouseEventInit, val: Option<&EventTarget>); + #[wasm_bindgen(method, setter = "screenX")] + fn screen_x_shim(this: &MouseEventInit, val: i32); + #[wasm_bindgen(method, setter = "screenY")] + fn screen_y_shim(this: &MouseEventInit, val: i32); } impl MouseEventInit { #[doc = "Construct a new `MouseEventInit`."] @@ -24,65 +80,28 @@ impl MouseEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,330 +109,140 @@ impl MouseEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } #[doc = "Change the `button` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.button_shim(val); self } #[doc = "Change the `buttons` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buttons_shim(val); self } #[doc = "Change the `clientX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_x_shim(val); self } #[doc = "Change the `clientY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_y_shim(val); self } #[doc = "Change the `movementX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_x_shim(val); self } #[doc = "Change the `movementY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_y_shim(val); self } #[cfg(feature = "EventTarget")] @@ -421,51 +250,21 @@ impl MouseEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `MouseEventInit`*"] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.related_target_shim(val); self } #[doc = "Change the `screenX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_x_shim(val); self } #[doc = "Change the `screenY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_y_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MutationObserverInit.rs b/crates/web-sys/src/features/gen_MutationObserverInit.rs index 736ea70929d..35251f2f6e8 100644 --- a/crates/web-sys/src/features/gen_MutationObserverInit.rs +++ b/crates/web-sys/src/features/gen_MutationObserverInit.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub type MutationObserverInit; + #[wasm_bindgen(method, setter = "animations")] + fn animations_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "attributeFilter")] + fn attribute_filter_shim(this: &MutationObserverInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "attributeOldValue")] + fn attribute_old_value_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "attributes")] + fn attributes_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "characterData")] + fn character_data_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "characterDataOldValue")] + fn character_data_old_value_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "childList")] + fn child_list_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "nativeAnonymousChildList")] + fn native_anonymous_child_list_shim(this: &MutationObserverInit, val: bool); + #[wasm_bindgen(method, setter = "subtree")] + fn subtree_shim(this: &MutationObserverInit, val: bool); } impl MutationObserverInit { #[doc = "Construct a new `MutationObserverInit`."] @@ -24,153 +42,63 @@ impl MutationObserverInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn animations(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("animations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.animations_shim(val); self } #[doc = "Change the `attributeFilter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn attribute_filter(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attribute_filter_shim(val); self } #[doc = "Change the `attributeOldValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn attribute_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attribute_old_value_shim(val); self } #[doc = "Change the `attributes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn attributes(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attributes_shim(val); self } #[doc = "Change the `characterData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn character_data(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.character_data_shim(val); self } #[doc = "Change the `characterDataOldValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn character_data_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterDataOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.character_data_old_value_shim(val); self } #[doc = "Change the `childList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("childList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.child_list_shim(val); self } #[doc = "Change the `nativeAnonymousChildList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn native_anonymous_child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nativeAnonymousChildList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.native_anonymous_child_list_shim(val); self } #[doc = "Change the `subtree` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub fn subtree(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subtree"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.subtree_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_MutationObservingInfo.rs b/crates/web-sys/src/features/gen_MutationObservingInfo.rs index 38d26e33323..ebe00cccdf0 100644 --- a/crates/web-sys/src/features/gen_MutationObservingInfo.rs +++ b/crates/web-sys/src/features/gen_MutationObservingInfo.rs @@ -10,6 +10,27 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub type MutationObservingInfo; + #[wasm_bindgen(method, setter = "animations")] + fn animations_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "attributeFilter")] + fn attribute_filter_shim(this: &MutationObservingInfo, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "attributeOldValue")] + fn attribute_old_value_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "attributes")] + fn attributes_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "characterData")] + fn character_data_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "characterDataOldValue")] + fn character_data_old_value_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "childList")] + fn child_list_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "nativeAnonymousChildList")] + fn native_anonymous_child_list_shim(this: &MutationObservingInfo, val: bool); + #[wasm_bindgen(method, setter = "subtree")] + fn subtree_shim(this: &MutationObservingInfo, val: bool); + #[cfg(feature = "Node")] + #[wasm_bindgen(method, setter = "observedNode")] + fn observed_node_shim(this: &MutationObservingInfo, val: Option<&Node>); } impl MutationObservingInfo { #[doc = "Construct a new `MutationObservingInfo`."] @@ -24,153 +45,63 @@ impl MutationObservingInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn animations(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("animations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.animations_shim(val); self } #[doc = "Change the `attributeFilter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn attribute_filter(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attribute_filter_shim(val); self } #[doc = "Change the `attributeOldValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn attribute_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attribute_old_value_shim(val); self } #[doc = "Change the `attributes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn attributes(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attributes_shim(val); self } #[doc = "Change the `characterData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn character_data(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.character_data_shim(val); self } #[doc = "Change the `characterDataOldValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn character_data_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterDataOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.character_data_old_value_shim(val); self } #[doc = "Change the `childList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("childList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.child_list_shim(val); self } #[doc = "Change the `nativeAnonymousChildList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn native_anonymous_child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nativeAnonymousChildList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.native_anonymous_child_list_shim(val); self } #[doc = "Change the `subtree` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub fn subtree(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subtree"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.subtree_shim(val); self } #[cfg(feature = "Node")] @@ -178,17 +109,7 @@ impl MutationObservingInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`, `Node`*"] pub fn observed_node(&mut self, val: Option<&Node>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("observedNode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.observed_node_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs b/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs index d50a70e44b1..5245faddf78 100644 --- a/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs +++ b/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] pub type NativeOsFileReadOptions; + #[wasm_bindgen(method, setter = "bytes")] + fn bytes_shim(this: &NativeOsFileReadOptions, val: Option); + #[wasm_bindgen(method, setter = "encoding")] + fn encoding_shim(this: &NativeOsFileReadOptions, val: Option<&str>); } impl NativeOsFileReadOptions { #[doc = "Construct a new `NativeOsFileReadOptions`."] @@ -24,30 +28,14 @@ impl NativeOsFileReadOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] pub fn bytes(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("bytes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_shim(val); self } #[doc = "Change the `encoding` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] pub fn encoding(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encoding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.encoding_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs b/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs index 3e3c2fd082b..7310b9a165b 100644 --- a/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs +++ b/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub type NativeOsFileWriteAtomicOptions; + #[wasm_bindgen(method, setter = "backupTo")] + fn backup_to_shim(this: &NativeOsFileWriteAtomicOptions, val: Option<&str>); + #[wasm_bindgen(method, setter = "bytes")] + fn bytes_shim(this: &NativeOsFileWriteAtomicOptions, val: Option); + #[wasm_bindgen(method, setter = "flush")] + fn flush_shim(this: &NativeOsFileWriteAtomicOptions, val: bool); + #[wasm_bindgen(method, setter = "noOverwrite")] + fn no_overwrite_shim(this: &NativeOsFileWriteAtomicOptions, val: bool); + #[wasm_bindgen(method, setter = "tmpPath")] + fn tmp_path_shim(this: &NativeOsFileWriteAtomicOptions, val: Option<&str>); } impl NativeOsFileWriteAtomicOptions { #[doc = "Construct a new `NativeOsFileWriteAtomicOptions`."] @@ -24,77 +34,35 @@ impl NativeOsFileWriteAtomicOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub fn backup_to(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("backupTo"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.backup_to_shim(val); self } #[doc = "Change the `bytes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub fn bytes(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("bytes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_shim(val); self } #[doc = "Change the `flush` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub fn flush(&mut self, val: bool) -> &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.flush_shim(val); self } #[doc = "Change the `noOverwrite` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub fn no_overwrite(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noOverwrite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.no_overwrite_shim(val); self } #[doc = "Change the `tmpPath` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub fn tmp_path(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tmpPath"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tmp_path_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NetworkCommandOptions.rs b/crates/web-sys/src/features/gen_NetworkCommandOptions.rs index a50203b5aae..d90b1a5fcd7 100644 --- a/crates/web-sys/src/features/gen_NetworkCommandOptions.rs +++ b/crates/web-sys/src/features/gen_NetworkCommandOptions.rs @@ -10,6 +10,92 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub type NetworkCommandOptions; + #[wasm_bindgen(method, setter = "cmd")] + fn cmd_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "curExternalIfname")] + fn cur_external_ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "curInternalIfname")] + fn cur_internal_ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "dns1")] + fn dns1_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "dns1_long")] + fn dns1_long_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "dns2")] + fn dns2_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "dns2_long")] + fn dns2_long_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "dnses")] + fn dnses_shim(this: &NetworkCommandOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "domain")] + fn domain_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "enable")] + fn enable_shim(this: &NetworkCommandOptions, val: bool); + #[wasm_bindgen(method, setter = "enabled")] + fn enabled_shim(this: &NetworkCommandOptions, val: bool); + #[wasm_bindgen(method, setter = "endIp")] + fn end_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "externalIfname")] + fn external_ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "gateway")] + fn gateway_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "gateway_long")] + fn gateway_long_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "gateways")] + fn gateways_shim(this: &NetworkCommandOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "ifname")] + fn ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "interfaceList")] + fn interface_list_shim(this: &NetworkCommandOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "internalIfname")] + fn internal_ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "ip")] + fn ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "ipaddr")] + fn ipaddr_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "key")] + fn key_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "link")] + fn link_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "mask")] + fn mask_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "maskLength")] + fn mask_length_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "mtu")] + fn mtu_shim(this: &NetworkCommandOptions, val: i32); + #[wasm_bindgen(method, setter = "preExternalIfname")] + fn pre_external_ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "preInternalIfname")] + fn pre_internal_ifname_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "prefix")] + fn prefix_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "prefixLength")] + fn prefix_length_shim(this: &NetworkCommandOptions, val: u32); + #[wasm_bindgen(method, setter = "report")] + fn report_shim(this: &NetworkCommandOptions, val: bool); + #[wasm_bindgen(method, setter = "security")] + fn security_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "serverIp")] + fn server_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "ssid")] + fn ssid_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "startIp")] + fn start_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "threshold")] + fn threshold_shim(this: &NetworkCommandOptions, val: f64); + #[wasm_bindgen(method, setter = "usbEndIp")] + fn usb_end_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "usbStartIp")] + fn usb_start_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "wifiEndIp")] + fn wifi_end_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "wifiStartIp")] + fn wifi_start_ip_shim(this: &NetworkCommandOptions, val: &str); + #[wasm_bindgen(method, setter = "wifictrlinterfacename")] + fn wifictrlinterfacename_shim(this: &NetworkCommandOptions, val: &str); } impl NetworkCommandOptions { #[doc = "Construct a new `NetworkCommandOptions`."] @@ -24,661 +110,301 @@ impl NetworkCommandOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn cmd(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cmd"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cmd_shim(val); self } #[doc = "Change the `curExternalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn cur_external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curExternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cur_external_ifname_shim(val); self } #[doc = "Change the `curInternalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn cur_internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curInternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cur_internal_ifname_shim(val); self } #[doc = "Change the `dns1` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn dns1(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns1_shim(val); self } #[doc = "Change the `dns1_long` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn dns1_long(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns1_long"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns1_long_shim(val); self } #[doc = "Change the `dns2` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn dns2(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns2_shim(val); self } #[doc = "Change the `dns2_long` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn dns2_long(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns2_long"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns2_long_shim(val); self } #[doc = "Change the `dnses` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn dnses(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dnses"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dnses_shim(val); self } #[doc = "Change the `domain` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn domain(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("domain"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.domain_shim(val); self } #[doc = "Change the `enable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn enable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("enable"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.enable_shim(val); self } #[doc = "Change the `enabled` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("enabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.enabled_shim(val); self } #[doc = "Change the `endIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn end_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("endIp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_ip_shim(val); self } #[doc = "Change the `externalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("externalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.external_ifname_shim(val); self } #[doc = "Change the `gateway` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn gateway(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gateway_shim(val); self } #[doc = "Change the `gateway_long` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn gateway_long(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway_long"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gateway_long_shim(val); self } #[doc = "Change the `gateways` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn gateways(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateways"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gateways_shim(val); self } #[doc = "Change the `id` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn id(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `ifname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ifname"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ifname_shim(val); self } #[doc = "Change the `interfaceList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn interface_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interfaceList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.interface_list_shim(val); self } #[doc = "Change the `internalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("internalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.internal_ifname_shim(val); self } #[doc = "Change the `ip` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ip"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ip_shim(val); self } #[doc = "Change the `ipaddr` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn ipaddr(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ipaddr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ipaddr_shim(val); self } #[doc = "Change the `key` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn key(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("key"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_shim(val); self } #[doc = "Change the `link` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn link(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("link"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.link_shim(val); self } #[doc = "Change the `mask` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn mask(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mask_shim(val); self } #[doc = "Change the `maskLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn mask_length(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maskLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mask_length_shim(val); self } #[doc = "Change the `mode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } #[doc = "Change the `mtu` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn mtu(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mtu"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mtu_shim(val); self } #[doc = "Change the `preExternalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn pre_external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preExternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pre_external_ifname_shim(val); self } #[doc = "Change the `preInternalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn pre_internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preInternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pre_internal_ifname_shim(val); self } #[doc = "Change the `prefix` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prefix_shim(val); self } #[doc = "Change the `prefixLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn prefix_length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("prefixLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prefix_length_shim(val); self } #[doc = "Change the `report` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn report(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("report"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.report_shim(val); self } #[doc = "Change the `security` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn security(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("security"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.security_shim(val); self } #[doc = "Change the `serverIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn server_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serverIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.server_ip_shim(val); self } #[doc = "Change the `ssid` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn ssid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssid_shim(val); self } #[doc = "Change the `startIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn start_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.start_ip_shim(val); self } #[doc = "Change the `threshold` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn threshold(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("threshold"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.threshold_shim(val); self } #[doc = "Change the `usbEndIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn usb_end_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbEndIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usb_end_ip_shim(val); self } #[doc = "Change the `usbStartIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn usb_start_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbStartIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usb_start_ip_shim(val); self } #[doc = "Change the `wifiEndIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn wifi_end_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wifiEndIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.wifi_end_ip_shim(val); self } #[doc = "Change the `wifiStartIp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn wifi_start_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wifiStartIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.wifi_start_ip_shim(val); self } #[doc = "Change the `wifictrlinterfacename` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub fn wifictrlinterfacename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wifictrlinterfacename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.wifictrlinterfacename_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NetworkResultOptions.rs b/crates/web-sys/src/features/gen_NetworkResultOptions.rs index 44acd57ae2e..10662e3b521 100644 --- a/crates/web-sys/src/features/gen_NetworkResultOptions.rs +++ b/crates/web-sys/src/features/gen_NetworkResultOptions.rs @@ -10,6 +10,76 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub type NetworkResultOptions; + #[wasm_bindgen(method, setter = "broadcast")] + fn broadcast_shim(this: &NetworkResultOptions, val: bool); + #[wasm_bindgen(method, setter = "curExternalIfname")] + fn cur_external_ifname_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "curInternalIfname")] + fn cur_internal_ifname_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "dns1")] + fn dns1_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "dns1_str")] + fn dns1_str_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "dns2")] + fn dns2_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "dns2_str")] + fn dns2_str_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "enable")] + fn enable_shim(this: &NetworkResultOptions, val: bool); + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &NetworkResultOptions, val: bool); + #[wasm_bindgen(method, setter = "flag")] + fn flag_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "gateway")] + fn gateway_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "gateway_str")] + fn gateway_str_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "interfaceList")] + fn interface_list_shim(this: &NetworkResultOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "ipAddr")] + fn ip_addr_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "ipaddr")] + fn ipaddr_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "ipaddr_str")] + fn ipaddr_str_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "lease")] + fn lease_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "macAddr")] + fn mac_addr_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "mask")] + fn mask_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "mask_str")] + fn mask_str_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "netId")] + fn net_id_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "prefixLength")] + fn prefix_length_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "reply")] + fn reply_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "result")] + fn result_shim(this: &NetworkResultOptions, val: bool); + #[wasm_bindgen(method, setter = "resultCode")] + fn result_code_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "resultReason")] + fn result_reason_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "ret")] + fn ret_shim(this: &NetworkResultOptions, val: bool); + #[wasm_bindgen(method, setter = "route")] + fn route_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "server")] + fn server_shim(this: &NetworkResultOptions, val: i32); + #[wasm_bindgen(method, setter = "server_str")] + fn server_str_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "success")] + fn success_shim(this: &NetworkResultOptions, val: bool); + #[wasm_bindgen(method, setter = "topic")] + fn topic_shim(this: &NetworkResultOptions, val: &str); + #[wasm_bindgen(method, setter = "vendor_str")] + fn vendor_str_shim(this: &NetworkResultOptions, val: &str); } impl NetworkResultOptions { #[doc = "Construct a new `NetworkResultOptions`."] @@ -24,529 +94,245 @@ impl NetworkResultOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn broadcast(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("broadcast"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.broadcast_shim(val); self } #[doc = "Change the `curExternalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn cur_external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curExternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cur_external_ifname_shim(val); self } #[doc = "Change the `curInternalIfname` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn cur_internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curInternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cur_internal_ifname_shim(val); self } #[doc = "Change the `dns1` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn dns1(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns1_shim(val); self } #[doc = "Change the `dns1_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn dns1_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns1_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns1_str_shim(val); self } #[doc = "Change the `dns2` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn dns2(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns2_shim(val); self } #[doc = "Change the `dns2_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn dns2_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns2_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dns2_str_shim(val); self } #[doc = "Change the `enable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn enable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("enable"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.enable_shim(val); self } #[doc = "Change the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn error(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[doc = "Change the `flag` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn flag(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.flag_shim(val); self } #[doc = "Change the `gateway` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn gateway(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gateway_shim(val); self } #[doc = "Change the `gateway_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn gateway_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gateway_str_shim(val); self } #[doc = "Change the `id` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn id(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `interfaceList` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn interface_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interfaceList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.interface_list_shim(val); self } #[doc = "Change the `ipAddr` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn ip_addr(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ipAddr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ip_addr_shim(val); self } #[doc = "Change the `ipaddr` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn ipaddr(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ipaddr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ipaddr_shim(val); self } #[doc = "Change the `ipaddr_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn ipaddr_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ipaddr_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ipaddr_str_shim(val); self } #[doc = "Change the `lease` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn lease(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("lease"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lease_shim(val); self } #[doc = "Change the `macAddr` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn mac_addr(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("macAddr"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mac_addr_shim(val); self } #[doc = "Change the `mask` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn mask(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mask_shim(val); self } #[doc = "Change the `mask_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn mask_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mask_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mask_str_shim(val); self } #[doc = "Change the `netId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn net_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("netId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.net_id_shim(val); self } #[doc = "Change the `prefixLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn prefix_length(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("prefixLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prefix_length_shim(val); self } #[doc = "Change the `reason` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } #[doc = "Change the `reply` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn reply(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reply"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reply_shim(val); self } #[doc = "Change the `result` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn result(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("result"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.result_shim(val); self } #[doc = "Change the `resultCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn result_code(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resultCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.result_code_shim(val); self } #[doc = "Change the `resultReason` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn result_reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resultReason"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.result_reason_shim(val); self } #[doc = "Change the `ret` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn ret(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ret"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ret_shim(val); self } #[doc = "Change the `route` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn route(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("route"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.route_shim(val); self } #[doc = "Change the `server` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn server(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("server"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.server_shim(val); self } #[doc = "Change the `server_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn server_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("server_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.server_str_shim(val); self } #[doc = "Change the `success` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn success(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("success"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.success_shim(val); self } #[doc = "Change the `topic` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn topic(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("topic"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.topic_shim(val); self } #[doc = "Change the `vendor_str` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub fn vendor_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendor_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.vendor_str_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NodeFilter.rs b/crates/web-sys/src/features/gen_NodeFilter.rs index f5838a15181..9f41f29e589 100644 --- a/crates/web-sys/src/features/gen_NodeFilter.rs +++ b/crates/web-sys/src/features/gen_NodeFilter.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NodeFilter`*"] pub type NodeFilter; + #[wasm_bindgen(method, setter = "acceptNode")] + fn accept_node_shim(this: &NodeFilter, val: &::js_sys::Function); } impl NodeFilter { #[doc = "Construct a new `NodeFilter`."] @@ -24,17 +26,7 @@ impl NodeFilter { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NodeFilter`*"] pub fn accept_node(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceptNode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.accept_node_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NotificationAction.rs b/crates/web-sys/src/features/gen_NotificationAction.rs index 919e13c0f37..24bfb4d8b22 100644 --- a/crates/web-sys/src/features/gen_NotificationAction.rs +++ b/crates/web-sys/src/features/gen_NotificationAction.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] pub type NotificationAction; + #[wasm_bindgen(method, setter = "action")] + fn action_shim(this: &NotificationAction, val: &str); + #[wasm_bindgen(method, setter = "icon")] + fn icon_shim(this: &NotificationAction, val: &str); + #[wasm_bindgen(method, setter = "title")] + fn title_shim(this: &NotificationAction, val: &str); } impl NotificationAction { #[doc = "Construct a new `NotificationAction`."] @@ -26,40 +32,21 @@ impl NotificationAction { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] pub fn action(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("action"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.action_shim(val); self } #[doc = "Change the `icon` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.icon_shim(val); self } #[doc = "Change the `title` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] pub fn title(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("title"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.title_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NotificationEventInit.rs b/crates/web-sys/src/features/gen_NotificationEventInit.rs index 1f0e3f068c8..6e73ccc7bf2 100644 --- a/crates/web-sys/src/features/gen_NotificationEventInit.rs +++ b/crates/web-sys/src/features/gen_NotificationEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] pub type NotificationEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &NotificationEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &NotificationEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &NotificationEventInit, val: bool); + #[cfg(feature = "Notification")] + #[wasm_bindgen(method, setter = "notification")] + fn notification_shim(this: &NotificationEventInit, val: &Notification); } impl NotificationEventInit { #[cfg(feature = "Notification")] @@ -26,51 +35,21 @@ impl NotificationEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Notification")] @@ -78,17 +57,7 @@ impl NotificationEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationEventInit`*"] pub fn notification(&mut self, val: &Notification) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("notification"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.notification_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_NotificationOptions.rs b/crates/web-sys/src/features/gen_NotificationOptions.rs index ec01ac68a66..cd07eebe53a 100644 --- a/crates/web-sys/src/features/gen_NotificationOptions.rs +++ b/crates/web-sys/src/features/gen_NotificationOptions.rs @@ -10,6 +10,33 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub type NotificationOptions; + #[wasm_bindgen(method, setter = "actions")] + fn actions_shim(this: &NotificationOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "badge")] + fn badge_shim(this: &NotificationOptions, val: &str); + #[wasm_bindgen(method, setter = "body")] + fn body_shim(this: &NotificationOptions, val: &str); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &NotificationOptions, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "NotificationDirection")] + #[wasm_bindgen(method, setter = "dir")] + fn dir_shim(this: &NotificationOptions, val: NotificationDirection); + #[wasm_bindgen(method, setter = "icon")] + fn icon_shim(this: &NotificationOptions, val: &str); + #[wasm_bindgen(method, setter = "image")] + fn image_shim(this: &NotificationOptions, val: &str); + #[wasm_bindgen(method, setter = "lang")] + fn lang_shim(this: &NotificationOptions, val: &str); + #[wasm_bindgen(method, setter = "renotify")] + fn renotify_shim(this: &NotificationOptions, val: bool); + #[wasm_bindgen(method, setter = "requireInteraction")] + fn require_interaction_shim(this: &NotificationOptions, val: bool); + #[wasm_bindgen(method, setter = "silent")] + fn silent_shim(this: &NotificationOptions, val: Option); + #[wasm_bindgen(method, setter = "tag")] + fn tag_shim(this: &NotificationOptions, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &NotificationOptions, val: f64); } impl NotificationOptions { #[doc = "Construct a new `NotificationOptions`."] @@ -24,56 +51,28 @@ impl NotificationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn actions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("actions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.actions_shim(val); self } #[doc = "Change the `badge` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn badge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("badge"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.badge_shim(val); self } #[doc = "Change the `body` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn body(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("body"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.body_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[cfg(feature = "NotificationDirection")] @@ -81,130 +80,63 @@ impl NotificationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`, `NotificationOptions`*"] pub fn dir(&mut self, val: NotificationDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dir"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dir_shim(val); self } #[doc = "Change the `icon` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.icon_shim(val); self } #[doc = "Change the `image` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn image(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("image"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.image_shim(val); self } #[doc = "Change the `lang` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn lang(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("lang"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lang_shim(val); self } #[doc = "Change the `renotify` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn renotify(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("renotify"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.renotify_shim(val); self } #[doc = "Change the `requireInteraction` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn require_interaction(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requireInteraction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.require_interaction_shim(val); self } #[doc = "Change the `silent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn silent(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("silent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.silent_shim(val); self } #[doc = "Change the `tag` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn tag(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tag_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ObserverCallback.rs b/crates/web-sys/src/features/gen_ObserverCallback.rs index 6845b0ffd6d..6136af2a956 100644 --- a/crates/web-sys/src/features/gen_ObserverCallback.rs +++ b/crates/web-sys/src/features/gen_ObserverCallback.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`*"] pub type ObserverCallback; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &ObserverCallback, val: &::js_sys::Function); } impl ObserverCallback { #[doc = "Construct a new `ObserverCallback`."] @@ -24,17 +26,7 @@ impl ObserverCallback { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs b/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs index b69f605943b..dc607168d11 100644 --- a/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs +++ b/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] pub type OfflineAudioCompletionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &OfflineAudioCompletionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &OfflineAudioCompletionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &OfflineAudioCompletionEventInit, val: bool); + #[cfg(feature = "AudioBuffer")] + #[wasm_bindgen(method, setter = "renderedBuffer")] + fn rendered_buffer_shim(this: &OfflineAudioCompletionEventInit, val: &AudioBuffer); } impl OfflineAudioCompletionEventInit { #[cfg(feature = "AudioBuffer")] @@ -26,51 +35,21 @@ impl OfflineAudioCompletionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "AudioBuffer")] @@ -78,17 +57,7 @@ impl OfflineAudioCompletionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `OfflineAudioCompletionEventInit`*"] pub fn rendered_buffer(&mut self, val: &AudioBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("renderedBuffer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rendered_buffer_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs b/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs index 433659505c0..a60ff33bc11 100644 --- a/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs +++ b/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] pub type OfflineAudioContextOptions; + #[wasm_bindgen(method, setter = "length")] + fn length_shim(this: &OfflineAudioContextOptions, val: u32); + #[wasm_bindgen(method, setter = "numberOfChannels")] + fn number_of_channels_shim(this: &OfflineAudioContextOptions, val: u32); + #[wasm_bindgen(method, setter = "sampleRate")] + fn sample_rate_shim(this: &OfflineAudioContextOptions, val: f32); } impl OfflineAudioContextOptions { #[doc = "Construct a new `OfflineAudioContextOptions`."] @@ -26,48 +32,21 @@ impl OfflineAudioContextOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] pub fn length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_shim(val); self } #[doc = "Change the `numberOfChannels` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] pub fn number_of_channels(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfChannels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.number_of_channels_shim(val); self } #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] pub fn sample_rate(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_rate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs b/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs index 7662f05b2e2..533bef161de 100644 --- a/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs +++ b/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs @@ -14,6 +14,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 type OpenFilePickerOptions; + #[wasm_bindgen(method, setter = "excludeAcceptAllOption")] + fn exclude_accept_all_option_shim(this: &OpenFilePickerOptions, val: bool); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &OpenFilePickerOptions, val: &str); + #[wasm_bindgen(method, setter = "startIn")] + fn start_in_shim(this: &OpenFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "types")] + fn types_shim(this: &OpenFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "multiple")] + fn multiple_shim(this: &OpenFilePickerOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl OpenFilePickerOptions { @@ -36,17 +46,7 @@ impl OpenFilePickerOptions { #[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 exclude_accept_all_option(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("excludeAcceptAllOption"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exclude_accept_all_option_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +57,7 @@ impl OpenFilePickerOptions { #[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 id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +68,7 @@ impl OpenFilePickerOptions { #[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 start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startIn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.start_in_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,13 +79,7 @@ impl OpenFilePickerOptions { #[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 types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("types"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.types_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -112,17 +90,7 @@ impl OpenFilePickerOptions { #[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 multiple(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multiple"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.multiple_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs b/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs index 2c13e8bd999..326eedf30c9 100644 --- a/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs +++ b/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] pub type OpenWindowEventDetail; + #[wasm_bindgen(method, setter = "features")] + fn features_shim(this: &OpenWindowEventDetail, val: &str); + #[cfg(feature = "Node")] + #[wasm_bindgen(method, setter = "frameElement")] + fn frame_element_shim(this: &OpenWindowEventDetail, val: Option<&Node>); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &OpenWindowEventDetail, val: &str); + #[wasm_bindgen(method, setter = "url")] + fn url_shim(this: &OpenWindowEventDetail, val: &str); } impl OpenWindowEventDetail { #[doc = "Construct a new `OpenWindowEventDetail`."] @@ -24,17 +33,7 @@ impl OpenWindowEventDetail { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] pub fn features(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("features"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.features_shim(val); self } #[cfg(feature = "Node")] @@ -42,43 +41,21 @@ impl OpenWindowEventDetail { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`, `OpenWindowEventDetail`*"] pub fn frame_element(&mut self, val: Option<&Node>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameElement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_element_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `url` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.url_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_OptionalEffectTiming.rs b/crates/web-sys/src/features/gen_OptionalEffectTiming.rs index 6f751434162..a55b56f6bb6 100644 --- a/crates/web-sys/src/features/gen_OptionalEffectTiming.rs +++ b/crates/web-sys/src/features/gen_OptionalEffectTiming.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub type OptionalEffectTiming; + #[wasm_bindgen(method, setter = "delay")] + fn delay_shim(this: &OptionalEffectTiming, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &OptionalEffectTiming, val: PlaybackDirection); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &OptionalEffectTiming, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "easing")] + fn easing_shim(this: &OptionalEffectTiming, val: &str); + #[wasm_bindgen(method, setter = "endDelay")] + fn end_delay_shim(this: &OptionalEffectTiming, val: f64); + #[cfg(feature = "FillMode")] + #[wasm_bindgen(method, setter = "fill")] + fn fill_shim(this: &OptionalEffectTiming, val: FillMode); + #[wasm_bindgen(method, setter = "iterationStart")] + fn iteration_start_shim(this: &OptionalEffectTiming, val: f64); + #[wasm_bindgen(method, setter = "iterations")] + fn iterations_shim(this: &OptionalEffectTiming, val: f64); } impl OptionalEffectTiming { #[doc = "Construct a new `OptionalEffectTiming`."] @@ -24,13 +42,7 @@ impl OptionalEffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_shim(val); self } #[cfg(feature = "PlaybackDirection")] @@ -38,65 +50,28 @@ impl OptionalEffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`, `PlaybackDirection`*"] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[doc = "Change the `duration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[doc = "Change the `easing` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub fn easing(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.easing_shim(val); self } #[doc = "Change the `endDelay` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_delay_shim(val); self } #[cfg(feature = "FillMode")] @@ -104,47 +79,21 @@ impl OptionalEffectTiming { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FillMode`, `OptionalEffectTiming`*"] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fill_shim(val); self } #[doc = "Change the `iterationStart` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iteration_start_shim(val); self } #[doc = "Change the `iterations` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iterations_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_OscillatorOptions.rs b/crates/web-sys/src/features/gen_OscillatorOptions.rs index b03f091503c..52a53e00595 100644 --- a/crates/web-sys/src/features/gen_OscillatorOptions.rs +++ b/crates/web-sys/src/features/gen_OscillatorOptions.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] pub type OscillatorOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &OscillatorOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &OscillatorOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &OscillatorOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "detune")] + fn detune_shim(this: &OscillatorOptions, val: f32); + #[wasm_bindgen(method, setter = "frequency")] + fn frequency_shim(this: &OscillatorOptions, val: f32); + #[cfg(feature = "PeriodicWave")] + #[wasm_bindgen(method, setter = "periodicWave")] + fn periodic_wave_shim(this: &OscillatorOptions, val: &PeriodicWave); + #[cfg(feature = "OscillatorType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &OscillatorOptions, val: OscillatorType); } impl OscillatorOptions { #[doc = "Construct a new `OscillatorOptions`."] @@ -24,17 +42,7 @@ impl OscillatorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +50,7 @@ impl OscillatorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `OscillatorOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,48 +58,21 @@ impl OscillatorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `OscillatorOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `detune` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] pub fn detune(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detune"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detune_shim(val); self } #[doc = "Change the `frequency` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] pub fn frequency(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frequency"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frequency_shim(val); self } #[cfg(feature = "PeriodicWave")] @@ -109,17 +80,7 @@ impl OscillatorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `PeriodicWave`*"] pub fn periodic_wave(&mut self, val: &PeriodicWave) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("periodicWave"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.periodic_wave_shim(val); self } #[cfg(feature = "OscillatorType")] @@ -127,13 +88,7 @@ impl OscillatorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `OscillatorType`*"] pub fn type_(&mut self, val: OscillatorType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PageTransitionEventInit.rs b/crates/web-sys/src/features/gen_PageTransitionEventInit.rs index bcee3d8362f..3474f5bcb49 100644 --- a/crates/web-sys/src/features/gen_PageTransitionEventInit.rs +++ b/crates/web-sys/src/features/gen_PageTransitionEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub type PageTransitionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PageTransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PageTransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PageTransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "inFrameSwap")] + fn in_frame_swap_shim(this: &PageTransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "persisted")] + fn persisted_shim(this: &PageTransitionEventInit, val: bool); } impl PageTransitionEventInit { #[doc = "Construct a new `PageTransitionEventInit`."] @@ -24,85 +34,35 @@ impl PageTransitionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `inFrameSwap` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub fn in_frame_swap(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inFrameSwap"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.in_frame_swap_shim(val); self } #[doc = "Change the `persisted` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub fn persisted(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("persisted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.persisted_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PannerOptions.rs b/crates/web-sys/src/features/gen_PannerOptions.rs index 42aceaa07f3..357ea977eb0 100644 --- a/crates/web-sys/src/features/gen_PannerOptions.rs +++ b/crates/web-sys/src/features/gen_PannerOptions.rs @@ -10,6 +10,44 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub type PannerOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &PannerOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &PannerOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &PannerOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "coneInnerAngle")] + fn cone_inner_angle_shim(this: &PannerOptions, val: f64); + #[wasm_bindgen(method, setter = "coneOuterAngle")] + fn cone_outer_angle_shim(this: &PannerOptions, val: f64); + #[wasm_bindgen(method, setter = "coneOuterGain")] + fn cone_outer_gain_shim(this: &PannerOptions, val: f64); + #[cfg(feature = "DistanceModelType")] + #[wasm_bindgen(method, setter = "distanceModel")] + fn distance_model_shim(this: &PannerOptions, val: DistanceModelType); + #[wasm_bindgen(method, setter = "maxDistance")] + fn max_distance_shim(this: &PannerOptions, val: f64); + #[wasm_bindgen(method, setter = "orientationX")] + fn orientation_x_shim(this: &PannerOptions, val: f32); + #[wasm_bindgen(method, setter = "orientationY")] + fn orientation_y_shim(this: &PannerOptions, val: f32); + #[wasm_bindgen(method, setter = "orientationZ")] + fn orientation_z_shim(this: &PannerOptions, val: f32); + #[cfg(feature = "PanningModelType")] + #[wasm_bindgen(method, setter = "panningModel")] + fn panning_model_shim(this: &PannerOptions, val: PanningModelType); + #[wasm_bindgen(method, setter = "positionX")] + fn position_x_shim(this: &PannerOptions, val: f32); + #[wasm_bindgen(method, setter = "positionY")] + fn position_y_shim(this: &PannerOptions, val: f32); + #[wasm_bindgen(method, setter = "positionZ")] + fn position_z_shim(this: &PannerOptions, val: f32); + #[wasm_bindgen(method, setter = "refDistance")] + fn ref_distance_shim(this: &PannerOptions, val: f64); + #[wasm_bindgen(method, setter = "rolloffFactor")] + fn rolloff_factor_shim(this: &PannerOptions, val: f64); } impl PannerOptions { #[doc = "Construct a new `PannerOptions`."] @@ -24,17 +62,7 @@ impl PannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +70,7 @@ impl PannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `PannerOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,68 +78,28 @@ impl PannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `PannerOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `coneInnerAngle` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn cone_inner_angle(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coneInnerAngle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cone_inner_angle_shim(val); self } #[doc = "Change the `coneOuterAngle` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn cone_outer_angle(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coneOuterAngle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cone_outer_angle_shim(val); self } #[doc = "Change the `coneOuterGain` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn cone_outer_gain(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coneOuterGain"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cone_outer_gain_shim(val); self } #[cfg(feature = "DistanceModelType")] @@ -129,85 +107,35 @@ impl PannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DistanceModelType`, `PannerOptions`*"] pub fn distance_model(&mut self, val: DistanceModelType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("distanceModel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.distance_model_shim(val); self } #[doc = "Change the `maxDistance` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn max_distance(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDistance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_distance_shim(val); self } #[doc = "Change the `orientationX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn orientation_x(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("orientationX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.orientation_x_shim(val); self } #[doc = "Change the `orientationY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn orientation_y(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("orientationY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.orientation_y_shim(val); self } #[doc = "Change the `orientationZ` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn orientation_z(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("orientationZ"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.orientation_z_shim(val); self } #[cfg(feature = "PanningModelType")] @@ -215,102 +143,42 @@ impl PannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`, `PanningModelType`*"] pub fn panning_model(&mut self, val: PanningModelType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("panningModel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.panning_model_shim(val); self } #[doc = "Change the `positionX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn position_x(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("positionX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.position_x_shim(val); self } #[doc = "Change the `positionY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn position_y(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("positionY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.position_y_shim(val); self } #[doc = "Change the `positionZ` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn position_z(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("positionZ"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.position_z_shim(val); self } #[doc = "Change the `refDistance` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn ref_distance(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("refDistance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ref_distance_shim(val); self } #[doc = "Change the `rolloffFactor` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub fn rolloff_factor(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rolloffFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rolloff_factor_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs b/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs index 0e442cb2b64..91144f4a6e6 100644 --- a/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub type PaymentMethodChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PaymentMethodChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PaymentMethodChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PaymentMethodChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "methodDetails")] + fn method_details_shim(this: &PaymentMethodChangeEventInit, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "methodName")] + fn method_name_shim(this: &PaymentMethodChangeEventInit, val: &str); } impl PaymentMethodChangeEventInit { #[doc = "Construct a new `PaymentMethodChangeEventInit`."] @@ -25,85 +35,35 @@ impl PaymentMethodChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `methodDetails` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub fn method_details(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("methodDetails"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.method_details_shim(val); self } #[doc = "Change the `methodName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub fn method_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("methodName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.method_name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs b/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs index 5bf0fb7e3fd..0b096480b99 100644 --- a/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs +++ b/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] pub type PaymentRequestUpdateEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PaymentRequestUpdateEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PaymentRequestUpdateEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PaymentRequestUpdateEventInit, val: bool); } impl PaymentRequestUpdateEventInit { #[doc = "Construct a new `PaymentRequestUpdateEventInit`."] @@ -24,51 +30,21 @@ impl PaymentRequestUpdateEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_Pbkdf2Params.rs b/crates/web-sys/src/features/gen_Pbkdf2Params.rs index 13aafec0ea1..744c157c142 100644 --- a/crates/web-sys/src/features/gen_Pbkdf2Params.rs +++ b/crates/web-sys/src/features/gen_Pbkdf2Params.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] pub type Pbkdf2Params; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &Pbkdf2Params, val: &str); + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &Pbkdf2Params, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "iterations")] + fn iterations_shim(this: &Pbkdf2Params, val: u32); + #[wasm_bindgen(method, setter = "salt")] + fn salt_shim(this: &Pbkdf2Params, val: &::js_sys::Object); } impl Pbkdf2Params { #[doc = "Construct a new `Pbkdf2Params`."] @@ -33,56 +41,28 @@ impl Pbkdf2Params { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `hash` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } #[doc = "Change the `iterations` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] pub fn iterations(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.iterations_shim(val); self } #[doc = "Change the `salt` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] pub fn salt(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("salt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.salt_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs b/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs index ee66983790d..b83c1ba16a4 100644 --- a/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs +++ b/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs @@ -10,6 +10,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub type PerformanceEntryEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PerformanceEntryEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PerformanceEntryEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PerformanceEntryEventInit, val: bool); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &PerformanceEntryEventInit, val: f64); + #[wasm_bindgen(method, setter = "entryType")] + fn entry_type_shim(this: &PerformanceEntryEventInit, val: &str); + #[wasm_bindgen(method, setter = "epoch")] + fn epoch_shim(this: &PerformanceEntryEventInit, val: f64); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &PerformanceEntryEventInit, val: &str); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &PerformanceEntryEventInit, val: &str); + #[wasm_bindgen(method, setter = "startTime")] + fn start_time_shim(this: &PerformanceEntryEventInit, val: f64); } impl PerformanceEntryEventInit { #[doc = "Construct a new `PerformanceEntryEventInit`."] @@ -24,142 +42,63 @@ impl PerformanceEntryEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `duration` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[doc = "Change the `entryType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn entry_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_type_shim(val); self } #[doc = "Change the `epoch` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn epoch(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("epoch"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.epoch_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `origin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[doc = "Change the `startTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub fn start_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.start_time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs b/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs index 052aac4d7e8..f126babe13d 100644 --- a/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs +++ b/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] pub type PerformanceEntryFilterOptions; + #[wasm_bindgen(method, setter = "entryType")] + fn entry_type_shim(this: &PerformanceEntryFilterOptions, val: &str); + #[wasm_bindgen(method, setter = "initiatorType")] + fn initiator_type_shim(this: &PerformanceEntryFilterOptions, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &PerformanceEntryFilterOptions, val: &str); } impl PerformanceEntryFilterOptions { #[doc = "Construct a new `PerformanceEntryFilterOptions`."] @@ -24,47 +30,21 @@ impl PerformanceEntryFilterOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] pub fn entry_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_type_shim(val); self } #[doc = "Change the `initiatorType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] pub fn initiator_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initiatorType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.initiator_type_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PerformanceObserverInit.rs b/crates/web-sys/src/features/gen_PerformanceObserverInit.rs index e6c559aa225..d7ab2ac72b8 100644 --- a/crates/web-sys/src/features/gen_PerformanceObserverInit.rs +++ b/crates/web-sys/src/features/gen_PerformanceObserverInit.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] pub type PerformanceObserverInit; + #[wasm_bindgen(method, setter = "buffered")] + fn buffered_shim(this: &PerformanceObserverInit, val: bool); + #[wasm_bindgen(method, setter = "entryTypes")] + fn entry_types_shim(this: &PerformanceObserverInit, val: &::wasm_bindgen::JsValue); } impl PerformanceObserverInit { #[doc = "Construct a new `PerformanceObserverInit`."] @@ -25,34 +29,14 @@ impl PerformanceObserverInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] pub fn buffered(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buffered"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffered_shim(val); self } #[doc = "Change the `entryTypes` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] pub fn entry_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.entry_types_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs b/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs index 5c34222588c..66005726781 100644 --- a/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs +++ b/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveConstraints`*"] pub type PeriodicWaveConstraints; + #[wasm_bindgen(method, setter = "disableNormalization")] + fn disable_normalization_shim(this: &PeriodicWaveConstraints, val: bool); } impl PeriodicWaveConstraints { #[doc = "Construct a new `PeriodicWaveConstraints`."] @@ -24,17 +26,7 @@ impl PeriodicWaveConstraints { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveConstraints`*"] pub fn disable_normalization(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disableNormalization"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.disable_normalization_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs b/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs index bffe8632685..60a33a1061d 100644 --- a/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs +++ b/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] pub type PeriodicWaveOptions; + #[wasm_bindgen(method, setter = "disableNormalization")] + fn disable_normalization_shim(this: &PeriodicWaveOptions, val: bool); + #[wasm_bindgen(method, setter = "imag")] + fn imag_shim(this: &PeriodicWaveOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "real")] + fn real_shim(this: &PeriodicWaveOptions, val: &::wasm_bindgen::JsValue); } impl PeriodicWaveOptions { #[doc = "Construct a new `PeriodicWaveOptions`."] @@ -24,43 +30,21 @@ impl PeriodicWaveOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] pub fn disable_normalization(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disableNormalization"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.disable_normalization_shim(val); self } #[doc = "Change the `imag` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] pub fn imag(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("imag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.imag_shim(val); self } #[doc = "Change the `real` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] pub fn real(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("real"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.real_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PermissionDescriptor.rs b/crates/web-sys/src/features/gen_PermissionDescriptor.rs index 596b50b43e4..5d5777773f3 100644 --- a/crates/web-sys/src/features/gen_PermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_PermissionDescriptor.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`*"] pub type PermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &PermissionDescriptor, val: PermissionName); } impl PermissionDescriptor { #[cfg(feature = "PermissionName")] @@ -27,13 +30,7 @@ impl PermissionDescriptor { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"] pub fn name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PlaneLayout.rs b/crates/web-sys/src/features/gen_PlaneLayout.rs index d472a1a6fc6..d5859a0db5a 100644 --- a/crates/web-sys/src/features/gen_PlaneLayout.rs +++ b/crates/web-sys/src/features/gen_PlaneLayout.rs @@ -14,6 +14,10 @@ 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 type PlaneLayout; + #[wasm_bindgen(method, setter = "offset")] + fn offset_shim(this: &PlaneLayout, val: u32); + #[wasm_bindgen(method, setter = "stride")] + fn stride_shim(this: &PlaneLayout, val: u32); } #[cfg(web_sys_unstable_apis)] impl PlaneLayout { @@ -38,14 +42,7 @@ impl PlaneLayout { #[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 offset(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offset_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,14 +53,7 @@ impl PlaneLayout { #[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 stride(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stride"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stride_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs b/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs index ccbf61ed92c..4a1f9c3f77d 100644 --- a/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs +++ b/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs @@ -10,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub type PluginCrashedEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PluginCrashedEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PluginCrashedEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PluginCrashedEventInit, val: bool); + #[wasm_bindgen(method, setter = "browserDumpID")] + fn browser_dump_id_shim(this: &PluginCrashedEventInit, val: Option<&str>); + #[wasm_bindgen(method, setter = "gmpPlugin")] + fn gmp_plugin_shim(this: &PluginCrashedEventInit, val: bool); + #[wasm_bindgen(method, setter = "pluginDumpID")] + fn plugin_dump_id_shim(this: &PluginCrashedEventInit, val: &str); + #[wasm_bindgen(method, setter = "pluginFilename")] + fn plugin_filename_shim(this: &PluginCrashedEventInit, val: Option<&str>); + #[wasm_bindgen(method, setter = "pluginID")] + fn plugin_id_shim(this: &PluginCrashedEventInit, val: u32); + #[wasm_bindgen(method, setter = "pluginName")] + fn plugin_name_shim(this: &PluginCrashedEventInit, val: &str); + #[wasm_bindgen(method, setter = "submittedCrashReport")] + fn submitted_crash_report_shim(this: &PluginCrashedEventInit, val: bool); } impl PluginCrashedEventInit { #[doc = "Construct a new `PluginCrashedEventInit`."] @@ -24,170 +44,70 @@ impl PluginCrashedEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `browserDumpID` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn browser_dump_id(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("browserDumpID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.browser_dump_id_shim(val); self } #[doc = "Change the `gmpPlugin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn gmp_plugin(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gmpPlugin"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.gmp_plugin_shim(val); self } #[doc = "Change the `pluginDumpID` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn plugin_dump_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginDumpID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.plugin_dump_id_shim(val); self } #[doc = "Change the `pluginFilename` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn plugin_filename(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginFilename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.plugin_filename_shim(val); self } #[doc = "Change the `pluginID` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn plugin_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.plugin_id_shim(val); self } #[doc = "Change the `pluginName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn plugin_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.plugin_name_shim(val); self } #[doc = "Change the `submittedCrashReport` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub fn submitted_crash_report(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("submittedCrashReport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.submitted_crash_report_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PointerEventInit.rs b/crates/web-sys/src/features/gen_PointerEventInit.rs index ba1339fbe3c..33a30240346 100644 --- a/crates/web-sys/src/features/gen_PointerEventInit.rs +++ b/crates/web-sys/src/features/gen_PointerEventInit.rs @@ -10,6 +10,84 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub type PointerEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &PointerEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &PointerEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "button")] + fn button_shim(this: &PointerEventInit, val: i16); + #[wasm_bindgen(method, setter = "buttons")] + fn buttons_shim(this: &PointerEventInit, val: u16); + #[wasm_bindgen(method, setter = "clientX")] + fn client_x_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "clientY")] + fn client_y_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementX")] + fn movement_x_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementY")] + fn movement_y_shim(this: &PointerEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[wasm_bindgen(method, setter = "relatedTarget")] + fn related_target_shim(this: &PointerEventInit, val: Option<&EventTarget>); + #[wasm_bindgen(method, setter = "screenX")] + fn screen_x_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "screenY")] + fn screen_y_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "coalescedEvents")] + fn coalesced_events_shim(this: &PointerEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "isPrimary")] + fn is_primary_shim(this: &PointerEventInit, val: bool); + #[wasm_bindgen(method, setter = "pointerId")] + fn pointer_id_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "pointerType")] + fn pointer_type_shim(this: &PointerEventInit, val: &str); + #[wasm_bindgen(method, setter = "pressure")] + fn pressure_shim(this: &PointerEventInit, val: f32); + #[wasm_bindgen(method, setter = "tangentialPressure")] + fn tangential_pressure_shim(this: &PointerEventInit, val: f32); + #[wasm_bindgen(method, setter = "tiltX")] + fn tilt_x_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "tiltY")] + fn tilt_y_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "twist")] + fn twist_shim(this: &PointerEventInit, val: i32); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &PointerEventInit, val: i32); } impl PointerEventInit { #[doc = "Construct a new `PointerEventInit`."] @@ -24,65 +102,28 @@ impl PointerEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,330 +131,140 @@ impl PointerEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } #[doc = "Change the `button` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.button_shim(val); self } #[doc = "Change the `buttons` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buttons_shim(val); self } #[doc = "Change the `clientX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_x_shim(val); self } #[doc = "Change the `clientY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_y_shim(val); self } #[doc = "Change the `movementX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_x_shim(val); self } #[doc = "Change the `movementY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_y_shim(val); self } #[cfg(feature = "EventTarget")] @@ -421,219 +272,98 @@ impl PointerEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `PointerEventInit`*"] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.related_target_shim(val); self } #[doc = "Change the `screenX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_x_shim(val); self } #[doc = "Change the `screenY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_y_shim(val); self } #[doc = "Change the `coalescedEvents` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn coalesced_events(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coalescedEvents"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.coalesced_events_shim(val); self } #[doc = "Change the `height` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `isPrimary` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn is_primary(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isPrimary"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_primary_shim(val); self } #[doc = "Change the `pointerId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn pointer_id(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pointerId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pointer_id_shim(val); self } #[doc = "Change the `pointerType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn pointer_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pointerType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pointer_type_shim(val); self } #[doc = "Change the `pressure` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn pressure(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pressure"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pressure_shim(val); self } #[doc = "Change the `tangentialPressure` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn tangential_pressure(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tangentialPressure"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tangential_pressure_shim(val); self } #[doc = "Change the `tiltX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn tilt_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tiltX"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tilt_x_shim(val); self } #[doc = "Change the `tiltY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn tilt_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tiltY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tilt_y_shim(val); self } #[doc = "Change the `twist` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn twist(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("twist"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.twist_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PopStateEventInit.rs b/crates/web-sys/src/features/gen_PopStateEventInit.rs index 6249561086c..e00ea0f3eae 100644 --- a/crates/web-sys/src/features/gen_PopStateEventInit.rs +++ b/crates/web-sys/src/features/gen_PopStateEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] pub type PopStateEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PopStateEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PopStateEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PopStateEventInit, val: bool); + #[wasm_bindgen(method, setter = "state")] + fn state_shim(this: &PopStateEventInit, val: &::wasm_bindgen::JsValue); } impl PopStateEventInit { #[doc = "Construct a new `PopStateEventInit`."] @@ -24,64 +32,28 @@ impl PopStateEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `state` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] pub fn state(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("state"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.state_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs b/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs index ff9fc12cb62..3e1d3043190 100644 --- a/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs +++ b/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub type PopupBlockedEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PopupBlockedEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PopupBlockedEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PopupBlockedEventInit, val: bool); + #[wasm_bindgen(method, setter = "popupWindowFeatures")] + fn popup_window_features_shim(this: &PopupBlockedEventInit, val: &str); + #[wasm_bindgen(method, setter = "popupWindowName")] + fn popup_window_name_shim(this: &PopupBlockedEventInit, val: &str); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "requestingWindow")] + fn requesting_window_shim(this: &PopupBlockedEventInit, val: Option<&Window>); } impl PopupBlockedEventInit { #[doc = "Construct a new `PopupBlockedEventInit`."] @@ -24,85 +37,35 @@ impl PopupBlockedEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `popupWindowFeatures` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub fn popup_window_features(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("popupWindowFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.popup_window_features_shim(val); self } #[doc = "Change the `popupWindowName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub fn popup_window_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("popupWindowName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.popup_window_name_shim(val); self } #[cfg(feature = "Window")] @@ -110,17 +73,7 @@ impl PopupBlockedEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`, `Window`*"] pub fn requesting_window(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requestingWindow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.requesting_window_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PositionOptions.rs b/crates/web-sys/src/features/gen_PositionOptions.rs index c5d8789e3bc..2d5d5276299 100644 --- a/crates/web-sys/src/features/gen_PositionOptions.rs +++ b/crates/web-sys/src/features/gen_PositionOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] pub type PositionOptions; + #[wasm_bindgen(method, setter = "enableHighAccuracy")] + fn enable_high_accuracy_shim(this: &PositionOptions, val: bool); + #[wasm_bindgen(method, setter = "maximumAge")] + fn maximum_age_shim(this: &PositionOptions, val: u32); + #[wasm_bindgen(method, setter = "timeout")] + fn timeout_shim(this: &PositionOptions, val: u32); } impl PositionOptions { #[doc = "Construct a new `PositionOptions`."] @@ -24,51 +30,21 @@ impl PositionOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] pub fn enable_high_accuracy(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("enableHighAccuracy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.enable_high_accuracy_shim(val); self } #[doc = "Change the `maximumAge` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] pub fn maximum_age(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maximumAge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.maximum_age_shim(val); self } #[doc = "Change the `timeout` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timeout_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs b/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs index 91bc99d265f..146db924710 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] pub type PresentationConnectionAvailableEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PresentationConnectionAvailableEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PresentationConnectionAvailableEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PresentationConnectionAvailableEventInit, val: bool); + #[cfg(feature = "PresentationConnection")] + #[wasm_bindgen(method, setter = "connection")] + fn connection_shim( + this: &PresentationConnectionAvailableEventInit, + val: &PresentationConnection, + ); } impl PresentationConnectionAvailableEventInit { #[cfg(feature = "PresentationConnection")] @@ -26,51 +38,21 @@ impl PresentationConnectionAvailableEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "PresentationConnection")] @@ -78,17 +60,7 @@ impl PresentationConnectionAvailableEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`, `PresentationConnectionAvailableEventInit`*"] pub fn connection(&mut self, val: &PresentationConnection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connection"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.connection_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs b/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs index 2fc2a1ba233..c7786dacd06 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] pub type PresentationConnectionCloseEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PresentationConnectionCloseEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PresentationConnectionCloseEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PresentationConnectionCloseEventInit, val: bool); + #[wasm_bindgen(method, setter = "message")] + fn message_shim(this: &PresentationConnectionCloseEventInit, val: &str); + #[cfg(feature = "PresentationConnectionClosedReason")] + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim( + this: &PresentationConnectionCloseEventInit, + val: PresentationConnectionClosedReason, + ); } impl PresentationConnectionCloseEventInit { #[cfg(feature = "PresentationConnectionClosedReason")] @@ -26,68 +40,28 @@ impl PresentationConnectionCloseEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `message` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_shim(val); self } #[cfg(feature = "PresentationConnectionClosedReason")] @@ -95,14 +69,7 @@ impl PresentationConnectionCloseEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"] pub fn reason(&mut self, val: PresentationConnectionClosedReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs b/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs index 5d30196fc22..7ab50ae8bb7 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] pub type ProfileTimelineLayerRect; + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &ProfileTimelineLayerRect, val: i32); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &ProfileTimelineLayerRect, val: i32); + #[wasm_bindgen(method, setter = "x")] + fn x_shim(this: &ProfileTimelineLayerRect, val: i32); + #[wasm_bindgen(method, setter = "y")] + fn y_shim(this: &ProfileTimelineLayerRect, val: i32); } impl ProfileTimelineLayerRect { #[doc = "Construct a new `ProfileTimelineLayerRect`."] @@ -24,53 +32,28 @@ impl ProfileTimelineLayerRect { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } #[doc = "Change the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] pub fn x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_shim(val); self } #[doc = "Change the `y` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] pub fn y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.y_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs b/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs index 18d9da0ac39..acd1885a31d 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs @@ -10,6 +10,41 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub type ProfileTimelineMarker; + #[wasm_bindgen(method, setter = "causeName")] + fn cause_name_shim(this: &ProfileTimelineMarker, val: &str); + #[wasm_bindgen(method, setter = "end")] + fn end_shim(this: &ProfileTimelineMarker, val: f64); + #[wasm_bindgen(method, setter = "endStack")] + fn end_stack_shim(this: &ProfileTimelineMarker, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "eventPhase")] + fn event_phase_shim(this: &ProfileTimelineMarker, val: u16); + #[wasm_bindgen(method, setter = "isAnimationOnly")] + fn is_animation_only_shim(this: &ProfileTimelineMarker, val: bool); + #[wasm_bindgen(method, setter = "isOffMainThread")] + fn is_off_main_thread_shim(this: &ProfileTimelineMarker, val: bool); + #[cfg(feature = "ProfileTimelineMessagePortOperationType")] + #[wasm_bindgen(method, setter = "messagePortOperation")] + fn message_port_operation_shim( + this: &ProfileTimelineMarker, + val: ProfileTimelineMessagePortOperationType, + ); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &ProfileTimelineMarker, val: &str); + #[wasm_bindgen(method, setter = "processType")] + fn process_type_shim(this: &ProfileTimelineMarker, val: u16); + #[wasm_bindgen(method, setter = "rectangles")] + fn rectangles_shim(this: &ProfileTimelineMarker, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "stack")] + fn stack_shim(this: &ProfileTimelineMarker, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "start")] + fn start_shim(this: &ProfileTimelineMarker, val: f64); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &ProfileTimelineMarker, val: &str); + #[wasm_bindgen(method, setter = "unixTime")] + fn unix_time_shim(this: &ProfileTimelineMarker, val: f64); + #[cfg(feature = "ProfileTimelineWorkerOperationType")] + #[wasm_bindgen(method, setter = "workerOperation")] + fn worker_operation_shim(this: &ProfileTimelineMarker, val: ProfileTimelineWorkerOperationType); } impl ProfileTimelineMarker { #[doc = "Construct a new `ProfileTimelineMarker`."] @@ -24,98 +59,42 @@ impl ProfileTimelineMarker { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn cause_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("causeName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cause_name_shim(val); self } #[doc = "Change the `end` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn end(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("end"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_shim(val); self } #[doc = "Change the `endStack` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn end_stack(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endStack"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.end_stack_shim(val); self } #[doc = "Change the `eventPhase` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn event_phase(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("eventPhase"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.event_phase_shim(val); self } #[doc = "Change the `isAnimationOnly` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn is_animation_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isAnimationOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_animation_only_shim(val); self } #[doc = "Change the `isOffMainThread` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn is_off_main_thread(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isOffMainThread"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_off_main_thread_shim(val); self } #[cfg(feature = "ProfileTimelineMessagePortOperationType")] @@ -126,120 +105,56 @@ impl ProfileTimelineMarker { &mut self, val: ProfileTimelineMessagePortOperationType, ) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("messagePortOperation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_port_operation_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `processType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn process_type(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("processType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.process_type_shim(val); self } #[doc = "Change the `rectangles` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn rectangles(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rectangles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rectangles_shim(val); self } #[doc = "Change the `stack` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn stack(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stack"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stack_shim(val); self } #[doc = "Change the `start` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn start(&mut self, val: f64) -> &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.start_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } #[doc = "Change the `unixTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub fn unix_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unixTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.unix_time_shim(val); self } #[cfg(feature = "ProfileTimelineWorkerOperationType")] @@ -247,17 +162,7 @@ impl ProfileTimelineMarker { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineWorkerOperationType`*"] pub fn worker_operation(&mut self, val: ProfileTimelineWorkerOperationType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("workerOperation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.worker_operation_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs b/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs index c03a914b288..33a4ac48f09 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub type ProfileTimelineStackFrame; + #[wasm_bindgen(method, setter = "asyncCause")] + fn async_cause_shim(this: &ProfileTimelineStackFrame, val: &str); + #[wasm_bindgen(method, setter = "asyncParent")] + fn async_parent_shim(this: &ProfileTimelineStackFrame, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "column")] + fn column_shim(this: &ProfileTimelineStackFrame, val: i32); + #[wasm_bindgen(method, setter = "functionDisplayName")] + fn function_display_name_shim(this: &ProfileTimelineStackFrame, val: &str); + #[wasm_bindgen(method, setter = "line")] + fn line_shim(this: &ProfileTimelineStackFrame, val: i32); + #[wasm_bindgen(method, setter = "parent")] + fn parent_shim(this: &ProfileTimelineStackFrame, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &ProfileTimelineStackFrame, val: &str); } impl ProfileTimelineStackFrame { #[doc = "Construct a new `ProfileTimelineStackFrame`."] @@ -24,106 +38,49 @@ impl ProfileTimelineStackFrame { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn async_cause(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("asyncCause"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.async_cause_shim(val); self } #[doc = "Change the `asyncParent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn async_parent(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("asyncParent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.async_parent_shim(val); self } #[doc = "Change the `column` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn column(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("column"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.column_shim(val); self } #[doc = "Change the `functionDisplayName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn function_display_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("functionDisplayName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.function_display_name_shim(val); self } #[doc = "Change the `line` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn line(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("line"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.line_shim(val); self } #[doc = "Change the `parent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn parent(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("parent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.parent_shim(val); self } #[doc = "Change the `source` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub fn source(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ProgressEventInit.rs b/crates/web-sys/src/features/gen_ProgressEventInit.rs index df10539b726..f638b1dcad2 100644 --- a/crates/web-sys/src/features/gen_ProgressEventInit.rs +++ b/crates/web-sys/src/features/gen_ProgressEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub type ProgressEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ProgressEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ProgressEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ProgressEventInit, val: bool); + #[wasm_bindgen(method, setter = "lengthComputable")] + fn length_computable_shim(this: &ProgressEventInit, val: bool); + #[wasm_bindgen(method, setter = "loaded")] + fn loaded_shim(this: &ProgressEventInit, val: f64); + #[wasm_bindgen(method, setter = "total")] + fn total_shim(this: &ProgressEventInit, val: f64); } impl ProgressEventInit { #[doc = "Construct a new `ProgressEventInit`."] @@ -24,95 +36,42 @@ impl ProgressEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `lengthComputable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub fn length_computable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lengthComputable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.length_computable_shim(val); self } #[doc = "Change the `loaded` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub fn loaded(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loaded"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.loaded_shim(val); self } #[doc = "Change the `total` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub fn total(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("total"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.total_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs b/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs index 42aa52ae16d..05effa91c6e 100644 --- a/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs +++ b/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub type PromiseRejectionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PromiseRejectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PromiseRejectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PromiseRejectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "promise")] + fn promise_shim(this: &PromiseRejectionEventInit, val: &::js_sys::Promise); + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &PromiseRejectionEventInit, val: &::wasm_bindgen::JsValue); } impl PromiseRejectionEventInit { #[doc = "Construct a new `PromiseRejectionEventInit`."] @@ -25,82 +35,35 @@ impl PromiseRejectionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `promise` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub fn promise(&mut self, val: &::js_sys::Promise) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("promise"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.promise_shim(val); self } #[doc = "Change the `reason` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub fn reason(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs index d1f99e0ea19..bbd042e3033 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs @@ -10,6 +10,44 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] pub type PublicKeyCredentialCreationOptions; + #[cfg(feature = "AttestationConveyancePreference")] + #[wasm_bindgen(method, setter = "attestation")] + fn attestation_shim( + this: &PublicKeyCredentialCreationOptions, + val: AttestationConveyancePreference, + ); + #[cfg(feature = "AuthenticatorSelectionCriteria")] + #[wasm_bindgen(method, setter = "authenticatorSelection")] + fn authenticator_selection_shim( + this: &PublicKeyCredentialCreationOptions, + val: &AuthenticatorSelectionCriteria, + ); + #[wasm_bindgen(method, setter = "challenge")] + fn challenge_shim(this: &PublicKeyCredentialCreationOptions, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "excludeCredentials")] + fn exclude_credentials_shim( + this: &PublicKeyCredentialCreationOptions, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[wasm_bindgen(method, setter = "extensions")] + fn extensions_shim( + this: &PublicKeyCredentialCreationOptions, + val: &AuthenticationExtensionsClientInputs, + ); + #[wasm_bindgen(method, setter = "pubKeyCredParams")] + fn pub_key_cred_params_shim( + this: &PublicKeyCredentialCreationOptions, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "PublicKeyCredentialRpEntity")] + #[wasm_bindgen(method, setter = "rp")] + fn rp_shim(this: &PublicKeyCredentialCreationOptions, val: &PublicKeyCredentialRpEntity); + #[wasm_bindgen(method, setter = "timeout")] + fn timeout_shim(this: &PublicKeyCredentialCreationOptions, val: u32); + #[cfg(feature = "PublicKeyCredentialUserEntity")] + #[wasm_bindgen(method, setter = "user")] + fn user_shim(this: &PublicKeyCredentialCreationOptions, val: &PublicKeyCredentialUserEntity); } impl PublicKeyCredentialCreationOptions { #[cfg(all( @@ -38,17 +76,7 @@ impl PublicKeyCredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AttestationConveyancePreference`, `PublicKeyCredentialCreationOptions`*"] pub fn attestation(&mut self, val: AttestationConveyancePreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attestation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.attestation_shim(val); self } #[cfg(feature = "AuthenticatorSelectionCriteria")] @@ -56,51 +84,21 @@ impl PublicKeyCredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptions`*"] pub fn authenticator_selection(&mut self, val: &AuthenticatorSelectionCriteria) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("authenticatorSelection"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.authenticator_selection_shim(val); self } #[doc = "Change the `challenge` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.challenge_shim(val); self } #[doc = "Change the `excludeCredentials` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] pub fn exclude_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("excludeCredentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exclude_credentials_shim(val); self } #[cfg(feature = "AuthenticationExtensionsClientInputs")] @@ -108,34 +106,14 @@ impl PublicKeyCredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialCreationOptions`*"] pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.extensions_shim(val); self } #[doc = "Change the `pubKeyCredParams` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] pub fn pub_key_cred_params(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pubKeyCredParams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pub_key_cred_params_shim(val); self } #[cfg(feature = "PublicKeyCredentialRpEntity")] @@ -143,30 +121,14 @@ impl PublicKeyCredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`*"] pub fn rp(&mut self, val: &PublicKeyCredentialRpEntity) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rp_shim(val); self } #[doc = "Change the `timeout` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timeout_shim(val); self } #[cfg(feature = "PublicKeyCredentialUserEntity")] @@ -174,13 +136,7 @@ impl PublicKeyCredentialCreationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialUserEntity`*"] pub fn user(&mut self, val: &PublicKeyCredentialUserEntity) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("user"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.user_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs index 85e7c24ac6d..c2ca7cc04d7 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] pub type PublicKeyCredentialDescriptor; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &PublicKeyCredentialDescriptor, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "transports")] + fn transports_shim(this: &PublicKeyCredentialDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "PublicKeyCredentialType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &PublicKeyCredentialDescriptor, val: PublicKeyCredentialType); } impl PublicKeyCredentialDescriptor { #[cfg(feature = "PublicKeyCredentialType")] @@ -27,30 +34,14 @@ impl PublicKeyCredentialDescriptor { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] pub fn id(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `transports` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] pub fn transports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transports_shim(val); self } #[cfg(feature = "PublicKeyCredentialType")] @@ -58,13 +49,7 @@ impl PublicKeyCredentialDescriptor { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"] pub fn type_(&mut self, val: PublicKeyCredentialType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs index b1caf5c865b..6dc0e64c189 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] pub type PublicKeyCredentialEntity; + #[wasm_bindgen(method, setter = "icon")] + fn icon_shim(this: &PublicKeyCredentialEntity, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &PublicKeyCredentialEntity, val: &str); } impl PublicKeyCredentialEntity { #[doc = "Construct a new `PublicKeyCredentialEntity`."] @@ -25,26 +29,14 @@ impl PublicKeyCredentialEntity { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.icon_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs index bcf47f75c01..fd51859ddf6 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"] pub type PublicKeyCredentialParameters; + #[wasm_bindgen(method, setter = "alg")] + fn alg_shim(this: &PublicKeyCredentialParameters, val: i32); + #[cfg(feature = "PublicKeyCredentialType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &PublicKeyCredentialParameters, val: PublicKeyCredentialType); } impl PublicKeyCredentialParameters { #[cfg(feature = "PublicKeyCredentialType")] @@ -27,13 +32,7 @@ impl PublicKeyCredentialParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"] pub fn alg(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alg"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alg_shim(val); self } #[cfg(feature = "PublicKeyCredentialType")] @@ -41,13 +40,7 @@ impl PublicKeyCredentialParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"] pub fn type_(&mut self, val: PublicKeyCredentialType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs index 2c5fff91642..3528ea3d7db 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs @@ -10,6 +10,29 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] pub type PublicKeyCredentialRequestOptions; + #[wasm_bindgen(method, setter = "allowCredentials")] + fn allow_credentials_shim( + this: &PublicKeyCredentialRequestOptions, + val: &::wasm_bindgen::JsValue, + ); + #[wasm_bindgen(method, setter = "challenge")] + fn challenge_shim(this: &PublicKeyCredentialRequestOptions, val: &::js_sys::Object); + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[wasm_bindgen(method, setter = "extensions")] + fn extensions_shim( + this: &PublicKeyCredentialRequestOptions, + val: &AuthenticationExtensionsClientInputs, + ); + #[wasm_bindgen(method, setter = "rpId")] + fn rp_id_shim(this: &PublicKeyCredentialRequestOptions, val: &str); + #[wasm_bindgen(method, setter = "timeout")] + fn timeout_shim(this: &PublicKeyCredentialRequestOptions, val: u32); + #[cfg(feature = "UserVerificationRequirement")] + #[wasm_bindgen(method, setter = "userVerification")] + fn user_verification_shim( + this: &PublicKeyCredentialRequestOptions, + val: UserVerificationRequirement, + ); } impl PublicKeyCredentialRequestOptions { #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."] @@ -25,34 +48,14 @@ impl PublicKeyCredentialRequestOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] pub fn allow_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowCredentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.allow_credentials_shim(val); self } #[doc = "Change the `challenge` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.challenge_shim(val); self } #[cfg(feature = "AuthenticationExtensionsClientInputs")] @@ -60,47 +63,21 @@ impl PublicKeyCredentialRequestOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"] pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.extensions_shim(val); self } #[doc = "Change the `rpId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] pub fn rp_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rpId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rp_id_shim(val); self } #[doc = "Change the `timeout` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timeout_shim(val); self } #[cfg(feature = "UserVerificationRequirement")] @@ -108,17 +85,7 @@ impl PublicKeyCredentialRequestOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"] pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("userVerification"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.user_verification_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs index 15dba930a17..ac8318357da 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] pub type PublicKeyCredentialRpEntity; + #[wasm_bindgen(method, setter = "icon")] + fn icon_shim(this: &PublicKeyCredentialRpEntity, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &PublicKeyCredentialRpEntity, val: &str); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &PublicKeyCredentialRpEntity, val: &str); } impl PublicKeyCredentialRpEntity { #[doc = "Construct a new `PublicKeyCredentialRpEntity`."] @@ -25,39 +31,21 @@ impl PublicKeyCredentialRpEntity { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.icon_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `id` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs index fad8c8454b6..a720e3a36e7 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] pub type PublicKeyCredentialUserEntity; + #[wasm_bindgen(method, setter = "icon")] + fn icon_shim(this: &PublicKeyCredentialUserEntity, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &PublicKeyCredentialUserEntity, val: &str); + #[wasm_bindgen(method, setter = "displayName")] + fn display_name_shim(this: &PublicKeyCredentialUserEntity, val: &str); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &PublicKeyCredentialUserEntity, val: &::js_sys::Object); } impl PublicKeyCredentialUserEntity { #[doc = "Construct a new `PublicKeyCredentialUserEntity`."] @@ -27,56 +35,28 @@ impl PublicKeyCredentialUserEntity { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.icon_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `displayName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] pub fn display_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_name_shim(val); self } #[doc = "Change the `id` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] pub fn id(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PushEventInit.rs b/crates/web-sys/src/features/gen_PushEventInit.rs index 8d58c823577..5add3d2125d 100644 --- a/crates/web-sys/src/features/gen_PushEventInit.rs +++ b/crates/web-sys/src/features/gen_PushEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] pub type PushEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &PushEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &PushEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &PushEventInit, val: bool); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &PushEventInit, val: &::wasm_bindgen::JsValue); } impl PushEventInit { #[doc = "Construct a new `PushEventInit`."] @@ -24,64 +32,28 @@ impl PushEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionInit.rs b/crates/web-sys/src/features/gen_PushSubscriptionInit.rs index 60095c2e0f7..721c813742a 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionInit.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub type PushSubscriptionInit; + #[wasm_bindgen(method, setter = "appServerKey")] + fn app_server_key_shim(this: &PushSubscriptionInit, val: Option<&::js_sys::Object>); + #[wasm_bindgen(method, setter = "authSecret")] + fn auth_secret_shim(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>); + #[wasm_bindgen(method, setter = "endpoint")] + fn endpoint_shim(this: &PushSubscriptionInit, val: &str); + #[wasm_bindgen(method, setter = "p256dhKey")] + fn p256dh_key_shim(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>); + #[wasm_bindgen(method, setter = "scope")] + fn scope_shim(this: &PushSubscriptionInit, val: &str); } impl PushSubscriptionInit { #[doc = "Construct a new `PushSubscriptionInit`."] @@ -26,81 +36,35 @@ impl PushSubscriptionInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub fn app_server_key(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("appServerKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.app_server_key_shim(val); self } #[doc = "Change the `authSecret` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub fn auth_secret(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("authSecret"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auth_secret_shim(val); self } #[doc = "Change the `endpoint` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub fn endpoint(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endpoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.endpoint_shim(val); self } #[doc = "Change the `p256dhKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub fn p256dh_key(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("p256dhKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p256dh_key_shim(val); self } #[doc = "Change the `scope` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub fn scope(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("scope"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scope_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionJson.rs b/crates/web-sys/src/features/gen_PushSubscriptionJson.rs index 834be13d1e3..1fdb21c22bc 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionJson.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionJson.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`*"] pub type PushSubscriptionJson; + #[wasm_bindgen(method, setter = "endpoint")] + fn endpoint_shim(this: &PushSubscriptionJson, val: &str); + #[cfg(feature = "PushSubscriptionKeys")] + #[wasm_bindgen(method, setter = "keys")] + fn keys_shim(this: &PushSubscriptionJson, val: &PushSubscriptionKeys); } impl PushSubscriptionJson { #[doc = "Construct a new `PushSubscriptionJson`."] @@ -24,17 +29,7 @@ impl PushSubscriptionJson { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`*"] pub fn endpoint(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endpoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.endpoint_shim(val); self } #[cfg(feature = "PushSubscriptionKeys")] @@ -42,13 +37,7 @@ impl PushSubscriptionJson { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`, `PushSubscriptionKeys`*"] pub fn keys(&mut self, val: &PushSubscriptionKeys) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("keys"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.keys_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs b/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs index 80df7078043..f4b03611fba 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] pub type PushSubscriptionKeys; + #[wasm_bindgen(method, setter = "auth")] + fn auth_shim(this: &PushSubscriptionKeys, val: &str); + #[wasm_bindgen(method, setter = "p256dh")] + fn p256dh_shim(this: &PushSubscriptionKeys, val: &str); } impl PushSubscriptionKeys { #[doc = "Construct a new `PushSubscriptionKeys`."] @@ -24,27 +28,14 @@ impl PushSubscriptionKeys { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] pub fn auth(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("auth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.auth_shim(val); self } #[doc = "Change the `p256dh` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] pub fn p256dh(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p256dh"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.p256dh_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs b/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs index faa185a9580..ba2ce96b985 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] pub type PushSubscriptionOptionsInit; + #[wasm_bindgen(method, setter = "applicationServerKey")] + fn application_server_key_shim( + this: &PushSubscriptionOptionsInit, + val: &::wasm_bindgen::JsValue, + ); + #[wasm_bindgen(method, setter = "userVisibleOnly")] + fn user_visible_only_shim(this: &PushSubscriptionOptionsInit, val: bool); } impl PushSubscriptionOptionsInit { #[doc = "Construct a new `PushSubscriptionOptionsInit`."] @@ -24,34 +31,14 @@ impl PushSubscriptionOptionsInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] pub fn application_server_key(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("applicationServerKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.application_server_key_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } #[doc = "Change the `userVisibleOnly` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] pub fn user_visible_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("userVisibleOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.user_visible_only_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_QueryOptions.rs b/crates/web-sys/src/features/gen_QueryOptions.rs index 85967a95a0b..6ef1d3ad6c0 100644 --- a/crates/web-sys/src/features/gen_QueryOptions.rs +++ b/crates/web-sys/src/features/gen_QueryOptions.rs @@ -14,6 +14,8 @@ 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 type QueryOptions; + #[wasm_bindgen(method, setter = "postscriptNames")] + fn postscript_names_shim(this: &QueryOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl QueryOptions { @@ -36,17 +38,7 @@ impl QueryOptions { #[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 postscript_names(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("postscriptNames"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.postscript_names_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_QueuingStrategy.rs b/crates/web-sys/src/features/gen_QueuingStrategy.rs index aec86360b88..9ecbfa23cd1 100644 --- a/crates/web-sys/src/features/gen_QueuingStrategy.rs +++ b/crates/web-sys/src/features/gen_QueuingStrategy.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] pub type QueuingStrategy; + #[wasm_bindgen(method, setter = "highWaterMark")] + fn high_water_mark_shim(this: &QueuingStrategy, val: f64); + #[wasm_bindgen(method, setter = "size")] + fn size_shim(this: &QueuingStrategy, val: &::js_sys::Function); } impl QueuingStrategy { #[doc = "Construct a new `QueuingStrategy`."] @@ -24,30 +28,14 @@ impl QueuingStrategy { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] 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.high_water_mark_shim(val); self } #[doc = "Change the `size` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] pub fn size(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.size_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs index 253366ced8b..42523cd8b2f 100644 --- a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs +++ b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] pub type QueuingStrategyInit; + #[wasm_bindgen(method, setter = "highWaterMark")] + fn high_water_mark_shim(this: &QueuingStrategyInit, val: f64); } impl QueuingStrategyInit { #[doc = "Construct a new `QueuingStrategyInit`."] @@ -25,17 +27,7 @@ impl QueuingStrategyInit { #[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.high_water_mark_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RcwnPerfStats.rs b/crates/web-sys/src/features/gen_RcwnPerfStats.rs index 9a39f40cfc1..ee8fc7c302a 100644 --- a/crates/web-sys/src/features/gen_RcwnPerfStats.rs +++ b/crates/web-sys/src/features/gen_RcwnPerfStats.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] pub type RcwnPerfStats; + #[wasm_bindgen(method, setter = "avgLong")] + fn avg_long_shim(this: &RcwnPerfStats, val: u32); + #[wasm_bindgen(method, setter = "avgShort")] + fn avg_short_shim(this: &RcwnPerfStats, val: u32); + #[wasm_bindgen(method, setter = "stddevLong")] + fn stddev_long_shim(this: &RcwnPerfStats, val: u32); } impl RcwnPerfStats { #[doc = "Construct a new `RcwnPerfStats`."] @@ -24,51 +30,21 @@ impl RcwnPerfStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] pub fn avg_long(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("avgLong"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.avg_long_shim(val); self } #[doc = "Change the `avgShort` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] pub fn avg_short(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("avgShort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.avg_short_shim(val); self } #[doc = "Change the `stddevLong` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] pub fn stddev_long(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stddevLong"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stddev_long_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RcwnStatus.rs b/crates/web-sys/src/features/gen_RcwnStatus.rs index 9994b6a9564..e29982da89e 100644 --- a/crates/web-sys/src/features/gen_RcwnStatus.rs +++ b/crates/web-sys/src/features/gen_RcwnStatus.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub type RcwnStatus; + #[wasm_bindgen(method, setter = "cacheNotSlowCount")] + fn cache_not_slow_count_shim(this: &RcwnStatus, val: u32); + #[wasm_bindgen(method, setter = "cacheSlowCount")] + fn cache_slow_count_shim(this: &RcwnStatus, val: u32); + #[wasm_bindgen(method, setter = "perfStats")] + fn perf_stats_shim(this: &RcwnStatus, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "rcwnCacheWonCount")] + fn rcwn_cache_won_count_shim(this: &RcwnStatus, val: u32); + #[wasm_bindgen(method, setter = "rcwnNetWonCount")] + fn rcwn_net_won_count_shim(this: &RcwnStatus, val: u32); + #[wasm_bindgen(method, setter = "totalNetworkRequests")] + fn total_network_requests_shim(this: &RcwnStatus, val: u32); } impl RcwnStatus { #[doc = "Construct a new `RcwnStatus`."] @@ -24,102 +36,42 @@ impl RcwnStatus { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub fn cache_not_slow_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cacheNotSlowCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cache_not_slow_count_shim(val); self } #[doc = "Change the `cacheSlowCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub fn cache_slow_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cacheSlowCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cache_slow_count_shim(val); self } #[doc = "Change the `perfStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub fn perf_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("perfStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.perf_stats_shim(val); self } #[doc = "Change the `rcwnCacheWonCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub fn rcwn_cache_won_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rcwnCacheWonCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rcwn_cache_won_count_shim(val); self } #[doc = "Change the `rcwnNetWonCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub fn rcwn_net_won_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rcwnNetWonCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rcwn_net_won_count_shim(val); self } #[doc = "Change the `totalNetworkRequests` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub fn total_network_requests(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("totalNetworkRequests"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.total_network_requests_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs b/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs index 6636768f3de..ba38a2a7cd6 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamGetReaderOptions`*"] pub type ReadableStreamGetReaderOptions; + #[cfg(feature = "ReadableStreamReaderMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &ReadableStreamGetReaderOptions, val: ReadableStreamReaderMode); } impl ReadableStreamGetReaderOptions { #[doc = "Construct a new `ReadableStreamGetReaderOptions`."] @@ -25,13 +28,7 @@ impl ReadableStreamGetReaderOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamGetReaderOptions`, `ReadableStreamReaderMode`*"] pub fn mode(&mut self, val: ReadableStreamReaderMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs b/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs index 6ecfe1e046a..bd432a43d33 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"] pub type ReadableStreamIteratorOptions; + #[wasm_bindgen(method, setter = "preventCancel")] + fn prevent_cancel_shim(this: &ReadableStreamIteratorOptions, val: bool); } impl ReadableStreamIteratorOptions { #[doc = "Construct a new `ReadableStreamIteratorOptions`."] @@ -24,17 +26,7 @@ impl ReadableStreamIteratorOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"] pub fn prevent_cancel(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventCancel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prevent_cancel_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs index 7385e0043f4..1ee926ae577 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] pub type ReadableStreamReadResult; + #[wasm_bindgen(method, setter = "done")] + fn done_shim(this: &ReadableStreamReadResult, val: bool); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &ReadableStreamReadResult, val: &::wasm_bindgen::JsValue); } impl ReadableStreamReadResult { #[doc = "Construct a new `ReadableStreamReadResult`."] @@ -24,26 +28,14 @@ impl ReadableStreamReadResult { #[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.done_shim(val); 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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableWritablePair.rs b/crates/web-sys/src/features/gen_ReadableWritablePair.rs index fc98e0b9d26..3079c8805c3 100644 --- a/crates/web-sys/src/features/gen_ReadableWritablePair.rs +++ b/crates/web-sys/src/features/gen_ReadableWritablePair.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`*"] pub type ReadableWritablePair; + #[cfg(feature = "ReadableStream")] + #[wasm_bindgen(method, setter = "readable")] + fn readable_shim(this: &ReadableWritablePair, val: &ReadableStream); + #[cfg(feature = "WritableStream")] + #[wasm_bindgen(method, setter = "writable")] + fn writable_shim(this: &ReadableWritablePair, val: &WritableStream); } impl ReadableWritablePair { #[cfg(all(feature = "ReadableStream", feature = "WritableStream",))] @@ -28,17 +34,7 @@ impl ReadableWritablePair { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`*"] pub fn readable(&mut self, val: &ReadableStream) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("readable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.readable_shim(val); self } #[cfg(feature = "WritableStream")] @@ -46,17 +42,7 @@ impl ReadableWritablePair { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] pub fn writable(&mut self, val: &WritableStream) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.writable_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RegisterRequest.rs b/crates/web-sys/src/features/gen_RegisterRequest.rs index 457433d5989..f35b3953389 100644 --- a/crates/web-sys/src/features/gen_RegisterRequest.rs +++ b/crates/web-sys/src/features/gen_RegisterRequest.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] pub type RegisterRequest; + #[wasm_bindgen(method, setter = "challenge")] + fn challenge_shim(this: &RegisterRequest, val: &str); + #[wasm_bindgen(method, setter = "version")] + fn version_shim(this: &RegisterRequest, val: &str); } impl RegisterRequest { #[doc = "Construct a new `RegisterRequest`."] @@ -24,34 +28,14 @@ impl RegisterRequest { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] pub fn challenge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.challenge_shim(val); self } #[doc = "Change the `version` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RegisterResponse.rs b/crates/web-sys/src/features/gen_RegisterResponse.rs index ef6ee6dfbd5..eb73afa5f2c 100644 --- a/crates/web-sys/src/features/gen_RegisterResponse.rs +++ b/crates/web-sys/src/features/gen_RegisterResponse.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub type RegisterResponse; + #[wasm_bindgen(method, setter = "clientData")] + fn client_data_shim(this: &RegisterResponse, val: &str); + #[wasm_bindgen(method, setter = "errorCode")] + fn error_code_shim(this: &RegisterResponse, val: Option); + #[wasm_bindgen(method, setter = "errorMessage")] + fn error_message_shim(this: &RegisterResponse, val: Option<&str>); + #[wasm_bindgen(method, setter = "registrationData")] + fn registration_data_shim(this: &RegisterResponse, val: &str); + #[wasm_bindgen(method, setter = "version")] + fn version_shim(this: &RegisterResponse, val: &str); } impl RegisterResponse { #[doc = "Construct a new `RegisterResponse`."] @@ -24,85 +34,35 @@ impl RegisterResponse { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub fn client_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_data_shim(val); self } #[doc = "Change the `errorCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub fn error_code(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_code_shim(val); self } #[doc = "Change the `errorMessage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub fn error_message(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorMessage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_message_shim(val); self } #[doc = "Change the `registrationData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub fn registration_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("registrationData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.registration_data_shim(val); self } #[doc = "Change the `version` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RegisteredKey.rs b/crates/web-sys/src/features/gen_RegisteredKey.rs index 9a404b6ef52..34f727cbab4 100644 --- a/crates/web-sys/src/features/gen_RegisteredKey.rs +++ b/crates/web-sys/src/features/gen_RegisteredKey.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] pub type RegisteredKey; + #[wasm_bindgen(method, setter = "appId")] + fn app_id_shim(this: &RegisteredKey, val: Option<&str>); + #[wasm_bindgen(method, setter = "keyHandle")] + fn key_handle_shim(this: &RegisteredKey, val: &str); + #[wasm_bindgen(method, setter = "transports")] + fn transports_shim(this: &RegisteredKey, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "version")] + fn version_shim(this: &RegisteredKey, val: &str); } impl RegisteredKey { #[doc = "Construct a new `RegisteredKey`."] @@ -24,64 +32,28 @@ impl RegisteredKey { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] pub fn app_id(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("appId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.app_id_shim(val); self } #[doc = "Change the `keyHandle` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] pub fn key_handle(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyHandle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_handle_shim(val); self } #[doc = "Change the `transports` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] pub fn transports(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transports_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } #[doc = "Change the `version` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.version_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RegistrationOptions.rs b/crates/web-sys/src/features/gen_RegistrationOptions.rs index ebc9aa23702..8d635369a40 100644 --- a/crates/web-sys/src/features/gen_RegistrationOptions.rs +++ b/crates/web-sys/src/features/gen_RegistrationOptions.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] pub type RegistrationOptions; + #[wasm_bindgen(method, setter = "scope")] + fn scope_shim(this: &RegistrationOptions, val: &str); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RegistrationOptions, val: &str); + #[cfg(feature = "ServiceWorkerUpdateViaCache")] + #[wasm_bindgen(method, setter = "updateViaCache")] + fn update_via_cache_shim(this: &RegistrationOptions, val: ServiceWorkerUpdateViaCache); } impl RegistrationOptions { #[doc = "Construct a new `RegistrationOptions`."] @@ -24,26 +31,14 @@ impl RegistrationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] pub fn scope(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("scope"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scope_shim(val); self } #[doc = "Change the `type` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] pub fn type_(&mut self, val: &str) -> &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.type__shim(val); self } #[cfg(feature = "ServiceWorkerUpdateViaCache")] @@ -51,17 +46,7 @@ impl RegistrationOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerUpdateViaCache`*"] pub fn update_via_cache(&mut self, val: ServiceWorkerUpdateViaCache) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("updateViaCache"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.update_via_cache_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RequestDeviceOptions.rs b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs index 431ecfd15ef..85f4a2b5498 100644 --- a/crates/web-sys/src/features/gen_RequestDeviceOptions.rs +++ b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs @@ -14,6 +14,12 @@ 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 type RequestDeviceOptions; + #[wasm_bindgen(method, setter = "acceptAllDevices")] + fn accept_all_devices_shim(this: &RequestDeviceOptions, val: bool); + #[wasm_bindgen(method, setter = "filters")] + fn filters_shim(this: &RequestDeviceOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "optionalServices")] + fn optional_services_shim(this: &RequestDeviceOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl RequestDeviceOptions { @@ -36,17 +42,7 @@ impl RequestDeviceOptions { #[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 accept_all_devices(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceptAllDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.accept_all_devices_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +53,7 @@ impl RequestDeviceOptions { #[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 filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filters_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +64,7 @@ impl RequestDeviceOptions { #[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 optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalServices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.optional_services_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RequestInit.rs b/crates/web-sys/src/features/gen_RequestInit.rs index 820404406b7..532bdea1691 100644 --- a/crates/web-sys/src/features/gen_RequestInit.rs +++ b/crates/web-sys/src/features/gen_RequestInit.rs @@ -10,6 +10,37 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub type RequestInit; + #[wasm_bindgen(method, setter = "body")] + fn body_shim(this: &RequestInit, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "RequestCache")] + #[wasm_bindgen(method, setter = "cache")] + fn cache_shim(this: &RequestInit, val: RequestCache); + #[cfg(feature = "RequestCredentials")] + #[wasm_bindgen(method, setter = "credentials")] + fn credentials_shim(this: &RequestInit, val: RequestCredentials); + #[wasm_bindgen(method, setter = "headers")] + fn headers_shim(this: &RequestInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "integrity")] + fn integrity_shim(this: &RequestInit, val: &str); + #[wasm_bindgen(method, setter = "method")] + fn method_shim(this: &RequestInit, val: &str); + #[cfg(feature = "RequestMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &RequestInit, val: RequestMode); + #[cfg(feature = "ObserverCallback")] + #[wasm_bindgen(method, setter = "observe")] + fn observe_shim(this: &RequestInit, val: &ObserverCallback); + #[cfg(feature = "RequestRedirect")] + #[wasm_bindgen(method, setter = "redirect")] + fn redirect_shim(this: &RequestInit, val: RequestRedirect); + #[wasm_bindgen(method, setter = "referrer")] + fn referrer_shim(this: &RequestInit, val: &str); + #[cfg(feature = "ReferrerPolicy")] + #[wasm_bindgen(method, setter = "referrerPolicy")] + fn referrer_policy_shim(this: &RequestInit, val: ReferrerPolicy); + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &RequestInit, val: Option<&AbortSignal>); } impl RequestInit { #[doc = "Construct a new `RequestInit`."] @@ -24,13 +55,7 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub fn body(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("body"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.body_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } #[cfg(feature = "RequestCache")] @@ -38,13 +63,7 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestCache`, `RequestInit`*"] pub fn cache(&mut self, val: RequestCache) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cache"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cache_shim(val); self } #[cfg(feature = "RequestCredentials")] @@ -52,65 +71,28 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `RequestInit`*"] pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.credentials_shim(val); self } #[doc = "Change the `headers` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub fn headers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.headers_shim(val); self } #[doc = "Change the `integrity` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub fn integrity(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("integrity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.integrity_shim(val); self } #[doc = "Change the `method` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub fn method(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("method"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.method_shim(val); self } #[cfg(feature = "RequestMode")] @@ -118,13 +100,7 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestMode`*"] pub fn mode(&mut self, val: RequestMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } #[cfg(feature = "ObserverCallback")] @@ -132,17 +108,7 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`, `RequestInit`*"] pub fn observe(&mut self, val: &ObserverCallback) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("observe"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.observe_shim(val); self } #[cfg(feature = "RequestRedirect")] @@ -150,34 +116,14 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestRedirect`*"] pub fn redirect(&mut self, val: RequestRedirect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("redirect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.redirect_shim(val); self } #[doc = "Change the `referrer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub fn referrer(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.referrer_shim(val); self } #[cfg(feature = "ReferrerPolicy")] @@ -185,17 +131,7 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReferrerPolicy`, `RequestInit`*"] pub fn referrer_policy(&mut self, val: ReferrerPolicy) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrerPolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.referrer_policy_shim(val); self } #[cfg(feature = "AbortSignal")] @@ -203,14 +139,7 @@ impl RequestInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `RequestInit`*"] pub fn signal(&mut self, val: Option<&AbortSignal>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs b/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs index 3ddb95ee930..ea79accc1ef 100644 --- a/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs +++ b/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"] pub type RequestMediaKeySystemAccessNotification; + #[wasm_bindgen(method, setter = "keySystem")] + fn key_system_shim(this: &RequestMediaKeySystemAccessNotification, val: &str); + #[cfg(feature = "MediaKeySystemStatus")] + #[wasm_bindgen(method, setter = "status")] + fn status_shim(this: &RequestMediaKeySystemAccessNotification, val: MediaKeySystemStatus); } impl RequestMediaKeySystemAccessNotification { #[cfg(feature = "MediaKeySystemStatus")] @@ -27,17 +32,7 @@ impl RequestMediaKeySystemAccessNotification { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"] pub fn key_system(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keySystem"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_system_shim(val); self } #[cfg(feature = "MediaKeySystemStatus")] @@ -45,14 +40,7 @@ impl RequestMediaKeySystemAccessNotification { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"] pub fn status(&mut self, val: MediaKeySystemStatus) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.status_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ResizeObserverOptions.rs b/crates/web-sys/src/features/gen_ResizeObserverOptions.rs index cbd81683fee..322f2fbd507 100644 --- a/crates/web-sys/src/features/gen_ResizeObserverOptions.rs +++ b/crates/web-sys/src/features/gen_ResizeObserverOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"] pub type ResizeObserverOptions; + #[cfg(feature = "ResizeObserverBoxOptions")] + #[wasm_bindgen(method, setter = "box")] + fn box__shim(this: &ResizeObserverOptions, val: ResizeObserverBoxOptions); } impl ResizeObserverOptions { #[doc = "Construct a new `ResizeObserverOptions`."] @@ -25,13 +28,7 @@ impl ResizeObserverOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`, `ResizeObserverOptions`*"] pub fn box_(&mut self, val: ResizeObserverBoxOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("box"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.box__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ResponseInit.rs b/crates/web-sys/src/features/gen_ResponseInit.rs index d118a891da2..4466e72567d 100644 --- a/crates/web-sys/src/features/gen_ResponseInit.rs +++ b/crates/web-sys/src/features/gen_ResponseInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] pub type ResponseInit; + #[wasm_bindgen(method, setter = "headers")] + fn headers_shim(this: &ResponseInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "status")] + fn status_shim(this: &ResponseInit, val: u16); + #[wasm_bindgen(method, setter = "statusText")] + fn status_text_shim(this: &ResponseInit, val: &str); } impl ResponseInit { #[doc = "Construct a new `ResponseInit`."] @@ -24,48 +30,21 @@ impl ResponseInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] pub fn headers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.headers_shim(val); self } #[doc = "Change the `status` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] pub fn status(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.status_shim(val); self } #[doc = "Change the `statusText` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] pub fn status_text(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("statusText"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.status_text_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaHashedImportParams.rs b/crates/web-sys/src/features/gen_RsaHashedImportParams.rs index bb49bad7276..fd4c25042b3 100644 --- a/crates/web-sys/src/features/gen_RsaHashedImportParams.rs +++ b/crates/web-sys/src/features/gen_RsaHashedImportParams.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaHashedImportParams`*"] pub type RsaHashedImportParams; + #[wasm_bindgen(method, setter = "hash")] + fn hash_shim(this: &RsaHashedImportParams, val: &::wasm_bindgen::JsValue); } impl RsaHashedImportParams { #[doc = "Construct a new `RsaHashedImportParams`."] @@ -25,13 +27,7 @@ impl RsaHashedImportParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaHashedImportParams`*"] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hash_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaOaepParams.rs b/crates/web-sys/src/features/gen_RsaOaepParams.rs index fc02fee01e7..a500ce24ee7 100644 --- a/crates/web-sys/src/features/gen_RsaOaepParams.rs +++ b/crates/web-sys/src/features/gen_RsaOaepParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] pub type RsaOaepParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &RsaOaepParams, val: &str); + #[wasm_bindgen(method, setter = "label")] + fn label_shim(this: &RsaOaepParams, val: &::js_sys::Object); } impl RsaOaepParams { #[doc = "Construct a new `RsaOaepParams`."] @@ -25,26 +29,14 @@ impl RsaOaepParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] pub fn label(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.label_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs b/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs index 2d864189611..4071e4cd036 100644 --- a/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs +++ b/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] pub type RsaOtherPrimesInfo; + #[wasm_bindgen(method, setter = "d")] + fn d_shim(this: &RsaOtherPrimesInfo, val: &str); + #[wasm_bindgen(method, setter = "r")] + fn r_shim(this: &RsaOtherPrimesInfo, val: &str); + #[wasm_bindgen(method, setter = "t")] + fn t_shim(this: &RsaOtherPrimesInfo, val: &str); } impl RsaOtherPrimesInfo { #[doc = "Construct a new `RsaOtherPrimesInfo`."] @@ -27,39 +33,21 @@ impl RsaOtherPrimesInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] pub fn d(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.d_shim(val); self } #[doc = "Change the `r` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] pub fn r(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("r"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.r_shim(val); self } #[doc = "Change the `t` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] pub fn t(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("t"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.t_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaPssParams.rs b/crates/web-sys/src/features/gen_RsaPssParams.rs index 676c927de50..49ece0023e9 100644 --- a/crates/web-sys/src/features/gen_RsaPssParams.rs +++ b/crates/web-sys/src/features/gen_RsaPssParams.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] pub type RsaPssParams; + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &RsaPssParams, val: &str); + #[wasm_bindgen(method, setter = "saltLength")] + fn salt_length_shim(this: &RsaPssParams, val: u32); } impl RsaPssParams { #[doc = "Construct a new `RsaPssParams`."] @@ -26,30 +30,14 @@ impl RsaPssParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `saltLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] pub fn salt_length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("saltLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.salt_length_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs b/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs index c686a42b1da..7eab6969f61 100644 --- a/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs +++ b/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCertificateExpiration`*"] pub type RtcCertificateExpiration; + #[wasm_bindgen(method, setter = "expires")] + fn expires_shim(this: &RtcCertificateExpiration, val: f64); } impl RtcCertificateExpiration { #[doc = "Construct a new `RtcCertificateExpiration`."] @@ -24,17 +26,7 @@ impl RtcCertificateExpiration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCertificateExpiration`*"] pub fn expires(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expires"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.expires_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcCodecStats.rs b/crates/web-sys/src/features/gen_RtcCodecStats.rs index da150394db5..3fbd0842d81 100644 --- a/crates/web-sys/src/features/gen_RtcCodecStats.rs +++ b/crates/web-sys/src/features/gen_RtcCodecStats.rs @@ -10,6 +10,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub type RtcCodecStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcCodecStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcCodecStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcCodecStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "channels")] + fn channels_shim(this: &RtcCodecStats, val: u32); + #[wasm_bindgen(method, setter = "clockRate")] + fn clock_rate_shim(this: &RtcCodecStats, val: u32); + #[wasm_bindgen(method, setter = "codec")] + fn codec_shim(this: &RtcCodecStats, val: &str); + #[wasm_bindgen(method, setter = "parameters")] + fn parameters_shim(this: &RtcCodecStats, val: &str); + #[wasm_bindgen(method, setter = "payloadType")] + fn payload_type_shim(this: &RtcCodecStats, val: u32); } impl RtcCodecStats { #[doc = "Construct a new `RtcCodecStats`."] @@ -24,30 +41,14 @@ impl RtcCodecStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,94 +56,42 @@ impl RtcCodecStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `channels` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn channels(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channels_shim(val); self } #[doc = "Change the `clockRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn clock_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clockRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clock_rate_shim(val); self } #[doc = "Change the `codec` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_shim(val); self } #[doc = "Change the `parameters` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn parameters(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("parameters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.parameters_shim(val); self } #[doc = "Change the `payloadType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub fn payload_type(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("payloadType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.payload_type_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcConfiguration.rs b/crates/web-sys/src/features/gen_RtcConfiguration.rs index ab8a1ff7386..9d73017a32e 100644 --- a/crates/web-sys/src/features/gen_RtcConfiguration.rs +++ b/crates/web-sys/src/features/gen_RtcConfiguration.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] pub type RtcConfiguration; + #[cfg(feature = "RtcBundlePolicy")] + #[wasm_bindgen(method, setter = "bundlePolicy")] + fn bundle_policy_shim(this: &RtcConfiguration, val: RtcBundlePolicy); + #[wasm_bindgen(method, setter = "certificates")] + fn certificates_shim(this: &RtcConfiguration, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "iceServers")] + fn ice_servers_shim(this: &RtcConfiguration, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "RtcIceTransportPolicy")] + #[wasm_bindgen(method, setter = "iceTransportPolicy")] + fn ice_transport_policy_shim(this: &RtcConfiguration, val: RtcIceTransportPolicy); + #[wasm_bindgen(method, setter = "peerIdentity")] + fn peer_identity_shim(this: &RtcConfiguration, val: Option<&str>); } impl RtcConfiguration { #[doc = "Construct a new `RtcConfiguration`."] @@ -25,51 +37,21 @@ impl RtcConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcBundlePolicy`, `RtcConfiguration`*"] pub fn bundle_policy(&mut self, val: RtcBundlePolicy) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bundlePolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bundle_policy_shim(val); self } #[doc = "Change the `certificates` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] pub fn certificates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("certificates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.certificates_shim(val); self } #[doc = "Change the `iceServers` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] pub fn ice_servers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceServers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_servers_shim(val); self } #[cfg(feature = "RtcIceTransportPolicy")] @@ -77,34 +59,14 @@ impl RtcConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`, `RtcIceTransportPolicy`*"] pub fn ice_transport_policy(&mut self, val: RtcIceTransportPolicy) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceTransportPolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_transport_policy_shim(val); self } #[doc = "Change the `peerIdentity` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] pub fn peer_identity(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("peerIdentity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.peer_identity_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs b/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs index ca400a80ab2..bf64ac7bcd1 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] pub type RtcDataChannelEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &RtcDataChannelEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &RtcDataChannelEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &RtcDataChannelEventInit, val: bool); + #[cfg(feature = "RtcDataChannel")] + #[wasm_bindgen(method, setter = "channel")] + fn channel_shim(this: &RtcDataChannelEventInit, val: &RtcDataChannel); } impl RtcDataChannelEventInit { #[cfg(feature = "RtcDataChannel")] @@ -26,51 +35,21 @@ impl RtcDataChannelEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "RtcDataChannel")] @@ -78,17 +57,7 @@ impl RtcDataChannelEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelEventInit`*"] pub fn channel(&mut self, val: &RtcDataChannel) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcDataChannelInit.rs b/crates/web-sys/src/features/gen_RtcDataChannelInit.rs index 6e224f76ff2..915662ba9a1 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelInit.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelInit.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub type RtcDataChannelInit; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcDataChannelInit, val: u16); + #[wasm_bindgen(method, setter = "maxPacketLifeTime")] + fn max_packet_life_time_shim(this: &RtcDataChannelInit, val: u16); + #[wasm_bindgen(method, setter = "maxRetransmitTime")] + fn max_retransmit_time_shim(this: &RtcDataChannelInit, val: u16); + #[wasm_bindgen(method, setter = "maxRetransmits")] + fn max_retransmits_shim(this: &RtcDataChannelInit, val: u16); + #[wasm_bindgen(method, setter = "negotiated")] + fn negotiated_shim(this: &RtcDataChannelInit, val: bool); + #[wasm_bindgen(method, setter = "ordered")] + fn ordered_shim(this: &RtcDataChannelInit, val: bool); + #[wasm_bindgen(method, setter = "protocol")] + fn protocol_shim(this: &RtcDataChannelInit, val: &str); } impl RtcDataChannelInit { #[doc = "Construct a new `RtcDataChannelInit`."] @@ -24,115 +38,49 @@ impl RtcDataChannelInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `maxPacketLifeTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn max_packet_life_time(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxPacketLifeTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_packet_life_time_shim(val); self } #[doc = "Change the `maxRetransmitTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn max_retransmit_time(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxRetransmitTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_retransmit_time_shim(val); self } #[doc = "Change the `maxRetransmits` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn max_retransmits(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxRetransmits"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_retransmits_shim(val); self } #[doc = "Change the `negotiated` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn negotiated(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("negotiated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.negotiated_shim(val); self } #[doc = "Change the `ordered` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn ordered(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ordered"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ordered_shim(val); self } #[doc = "Change the `protocol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub fn protocol(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.protocol_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcFecParameters.rs b/crates/web-sys/src/features/gen_RtcFecParameters.rs index 6fe23c19cba..4ac685bf15c 100644 --- a/crates/web-sys/src/features/gen_RtcFecParameters.rs +++ b/crates/web-sys/src/features/gen_RtcFecParameters.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`*"] pub type RtcFecParameters; + #[wasm_bindgen(method, setter = "ssrc")] + fn ssrc_shim(this: &RtcFecParameters, val: u32); } impl RtcFecParameters { #[doc = "Construct a new `RtcFecParameters`."] @@ -24,13 +26,7 @@ impl RtcFecParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`*"] pub fn ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs b/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs index 70e3db9d925..9b4637f86a8 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] pub type RtcIceCandidateInit; + #[wasm_bindgen(method, setter = "candidate")] + fn candidate_shim(this: &RtcIceCandidateInit, val: &str); + #[wasm_bindgen(method, setter = "sdpMLineIndex")] + fn sdp_m_line_index_shim(this: &RtcIceCandidateInit, val: Option); + #[wasm_bindgen(method, setter = "sdpMid")] + fn sdp_mid_shim(this: &RtcIceCandidateInit, val: Option<&str>); } impl RtcIceCandidateInit { #[doc = "Construct a new `RtcIceCandidateInit`."] @@ -25,48 +31,21 @@ impl RtcIceCandidateInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] pub fn candidate(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.candidate_shim(val); self } #[doc = "Change the `sdpMLineIndex` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] pub fn sdp_m_line_index(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sdpMLineIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sdp_m_line_index_shim(val); self } #[doc = "Change the `sdpMid` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] pub fn sdp_mid(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sdpMid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sdp_mid_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs b/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs index 19932febf74..d2a83611f77 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs @@ -10,6 +10,42 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub type RtcIceCandidatePairStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcIceCandidatePairStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcIceCandidatePairStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcIceCandidatePairStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "bytesReceived")] + fn bytes_received_shim(this: &RtcIceCandidatePairStats, val: f64); + #[wasm_bindgen(method, setter = "bytesSent")] + fn bytes_sent_shim(this: &RtcIceCandidatePairStats, val: f64); + #[wasm_bindgen(method, setter = "componentId")] + fn component_id_shim(this: &RtcIceCandidatePairStats, val: u32); + #[wasm_bindgen(method, setter = "lastPacketReceivedTimestamp")] + fn last_packet_received_timestamp_shim(this: &RtcIceCandidatePairStats, val: f64); + #[wasm_bindgen(method, setter = "lastPacketSentTimestamp")] + fn last_packet_sent_timestamp_shim(this: &RtcIceCandidatePairStats, val: f64); + #[wasm_bindgen(method, setter = "localCandidateId")] + fn local_candidate_id_shim(this: &RtcIceCandidatePairStats, val: &str); + #[wasm_bindgen(method, setter = "nominated")] + fn nominated_shim(this: &RtcIceCandidatePairStats, val: bool); + #[wasm_bindgen(method, setter = "priority")] + fn priority_shim(this: &RtcIceCandidatePairStats, val: f64); + #[wasm_bindgen(method, setter = "readable")] + fn readable_shim(this: &RtcIceCandidatePairStats, val: bool); + #[wasm_bindgen(method, setter = "remoteCandidateId")] + fn remote_candidate_id_shim(this: &RtcIceCandidatePairStats, val: &str); + #[wasm_bindgen(method, setter = "selected")] + fn selected_shim(this: &RtcIceCandidatePairStats, val: bool); + #[cfg(feature = "RtcStatsIceCandidatePairState")] + #[wasm_bindgen(method, setter = "state")] + fn state_shim(this: &RtcIceCandidatePairStats, val: RtcStatsIceCandidatePairState); + #[wasm_bindgen(method, setter = "transportId")] + fn transport_id_shim(this: &RtcIceCandidatePairStats, val: &str); + #[wasm_bindgen(method, setter = "writable")] + fn writable_shim(this: &RtcIceCandidatePairStats, val: bool); } impl RtcIceCandidatePairStats { #[doc = "Construct a new `RtcIceCandidatePairStats`."] @@ -24,30 +60,14 @@ impl RtcIceCandidatePairStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,200 +75,84 @@ impl RtcIceCandidatePairStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `bytesReceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn bytes_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_received_shim(val); self } #[doc = "Change the `bytesSent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn bytes_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_sent_shim(val); self } #[doc = "Change the `componentId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn component_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("componentId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.component_id_shim(val); self } #[doc = "Change the `lastPacketReceivedTimestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn last_packet_received_timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastPacketReceivedTimestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_packet_received_timestamp_shim(val); self } #[doc = "Change the `lastPacketSentTimestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn last_packet_sent_timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastPacketSentTimestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.last_packet_sent_timestamp_shim(val); self } #[doc = "Change the `localCandidateId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn local_candidate_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localCandidateId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.local_candidate_id_shim(val); self } #[doc = "Change the `nominated` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn nominated(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nominated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.nominated_shim(val); self } #[doc = "Change the `priority` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn priority(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.priority_shim(val); self } #[doc = "Change the `readable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn readable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("readable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.readable_shim(val); self } #[doc = "Change the `remoteCandidateId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn remote_candidate_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteCandidateId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_candidate_id_shim(val); self } #[doc = "Change the `selected` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn selected(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selected"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.selected_shim(val); self } #[cfg(feature = "RtcStatsIceCandidatePairState")] @@ -256,47 +160,21 @@ impl RtcIceCandidatePairStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsIceCandidatePairState`*"] pub fn state(&mut self, val: RtcStatsIceCandidatePairState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("state"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.state_shim(val); self } #[doc = "Change the `transportId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_id_shim(val); self } #[doc = "Change the `writable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub fn writable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.writable_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs b/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs index fb9c65d4469..1b0e279c135 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs @@ -10,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub type RtcIceCandidateStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcIceCandidateStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcIceCandidateStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcIceCandidateStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "candidateId")] + fn candidate_id_shim(this: &RtcIceCandidateStats, val: &str); + #[cfg(feature = "RtcStatsIceCandidateType")] + #[wasm_bindgen(method, setter = "candidateType")] + fn candidate_type_shim(this: &RtcIceCandidateStats, val: RtcStatsIceCandidateType); + #[wasm_bindgen(method, setter = "componentId")] + fn component_id_shim(this: &RtcIceCandidateStats, val: &str); + #[wasm_bindgen(method, setter = "ipAddress")] + fn ip_address_shim(this: &RtcIceCandidateStats, val: &str); + #[wasm_bindgen(method, setter = "portNumber")] + fn port_number_shim(this: &RtcIceCandidateStats, val: i32); + #[wasm_bindgen(method, setter = "transport")] + fn transport_shim(this: &RtcIceCandidateStats, val: &str); } impl RtcIceCandidateStats { #[doc = "Construct a new `RtcIceCandidateStats`."] @@ -24,30 +44,14 @@ impl RtcIceCandidateStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,30 +59,14 @@ impl RtcIceCandidateStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `candidateId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn candidate_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidateId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.candidate_id_shim(val); self } #[cfg(feature = "RtcStatsIceCandidateType")] @@ -86,85 +74,35 @@ impl RtcIceCandidateStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"] pub fn candidate_type(&mut self, val: RtcStatsIceCandidateType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidateType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.candidate_type_shim(val); self } #[doc = "Change the `componentId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn component_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("componentId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.component_id_shim(val); self } #[doc = "Change the `ipAddress` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn ip_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ipAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ip_address_shim(val); self } #[doc = "Change the `portNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn port_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("portNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.port_number_shim(val); self } #[doc = "Change the `transport` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub fn transport(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceComponentStats.rs b/crates/web-sys/src/features/gen_RtcIceComponentStats.rs index a4154fd63fa..b9d84119d9d 100644 --- a/crates/web-sys/src/features/gen_RtcIceComponentStats.rs +++ b/crates/web-sys/src/features/gen_RtcIceComponentStats.rs @@ -10,6 +10,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub type RtcIceComponentStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcIceComponentStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcIceComponentStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcIceComponentStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "activeConnection")] + fn active_connection_shim(this: &RtcIceComponentStats, val: bool); + #[wasm_bindgen(method, setter = "bytesReceived")] + fn bytes_received_shim(this: &RtcIceComponentStats, val: u32); + #[wasm_bindgen(method, setter = "bytesSent")] + fn bytes_sent_shim(this: &RtcIceComponentStats, val: u32); + #[wasm_bindgen(method, setter = "component")] + fn component_shim(this: &RtcIceComponentStats, val: i32); + #[wasm_bindgen(method, setter = "transportId")] + fn transport_id_shim(this: &RtcIceComponentStats, val: &str); } impl RtcIceComponentStats { #[doc = "Construct a new `RtcIceComponentStats`."] @@ -24,30 +41,14 @@ impl RtcIceComponentStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,98 +56,42 @@ impl RtcIceComponentStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `activeConnection` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn active_connection(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("activeConnection"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.active_connection_shim(val); self } #[doc = "Change the `bytesReceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn bytes_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_received_shim(val); self } #[doc = "Change the `bytesSent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn bytes_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_sent_shim(val); self } #[doc = "Change the `component` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn component(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("component"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.component_shim(val); self } #[doc = "Change the `transportId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceServer.rs b/crates/web-sys/src/features/gen_RtcIceServer.rs index cde27056568..23937c63109 100644 --- a/crates/web-sys/src/features/gen_RtcIceServer.rs +++ b/crates/web-sys/src/features/gen_RtcIceServer.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] pub type RtcIceServer; + #[wasm_bindgen(method, setter = "credential")] + fn credential_shim(this: &RtcIceServer, val: &str); + #[cfg(feature = "RtcIceCredentialType")] + #[wasm_bindgen(method, setter = "credentialType")] + fn credential_type_shim(this: &RtcIceServer, val: RtcIceCredentialType); + #[wasm_bindgen(method, setter = "url")] + fn url_shim(this: &RtcIceServer, val: &str); + #[wasm_bindgen(method, setter = "urls")] + fn urls_shim(this: &RtcIceServer, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "username")] + fn username_shim(this: &RtcIceServer, val: &str); } impl RtcIceServer { #[doc = "Construct a new `RtcIceServer`."] @@ -24,17 +35,7 @@ impl RtcIceServer { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] pub fn credential(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credential"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.credential_shim(val); self } #[cfg(feature = "RtcIceCredentialType")] @@ -42,60 +43,28 @@ impl RtcIceServer { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCredentialType`, `RtcIceServer`*"] pub fn credential_type(&mut self, val: RtcIceCredentialType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentialType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.credential_type_shim(val); self } #[doc = "Change the `url` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.url_shim(val); self } #[doc = "Change the `urls` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] pub fn urls(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("urls"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.urls_shim(val); self } #[doc = "Change the `username` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] pub fn username(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("username"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.username_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs b/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs index 06a91917492..03e7922f9fc 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] pub type RtcIdentityAssertion; + #[wasm_bindgen(method, setter = "idp")] + fn idp_shim(this: &RtcIdentityAssertion, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &RtcIdentityAssertion, val: &str); } impl RtcIdentityAssertion { #[doc = "Construct a new `RtcIdentityAssertion`."] @@ -24,26 +28,14 @@ impl RtcIdentityAssertion { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] pub fn idp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("idp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.idp_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs b/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs index 326412d987c..186af70aded 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`*"] pub type RtcIdentityAssertionResult; + #[wasm_bindgen(method, setter = "assertion")] + fn assertion_shim(this: &RtcIdentityAssertionResult, val: &str); + #[cfg(feature = "RtcIdentityProviderDetails")] + #[wasm_bindgen(method, setter = "idp")] + fn idp_shim(this: &RtcIdentityAssertionResult, val: &RtcIdentityProviderDetails); } impl RtcIdentityAssertionResult { #[cfg(feature = "RtcIdentityProviderDetails")] @@ -27,17 +32,7 @@ impl RtcIdentityAssertionResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`*"] pub fn assertion(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("assertion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.assertion_shim(val); self } #[cfg(feature = "RtcIdentityProviderDetails")] @@ -45,13 +40,7 @@ impl RtcIdentityAssertionResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`, `RtcIdentityProviderDetails`*"] pub fn idp(&mut self, val: &RtcIdentityProviderDetails) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("idp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.idp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProvider.rs b/crates/web-sys/src/features/gen_RtcIdentityProvider.rs index 949a347273b..b2d6b76b5b0 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProvider.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProvider.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] pub type RtcIdentityProvider; + #[wasm_bindgen(method, setter = "generateAssertion")] + fn generate_assertion_shim(this: &RtcIdentityProvider, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "validateAssertion")] + fn validate_assertion_shim(this: &RtcIdentityProvider, val: &::js_sys::Function); } impl RtcIdentityProvider { #[doc = "Construct a new `RtcIdentityProvider`."] @@ -29,34 +33,14 @@ impl RtcIdentityProvider { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] pub fn generate_assertion(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("generateAssertion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.generate_assertion_shim(val); self } #[doc = "Change the `validateAssertion` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] pub fn validate_assertion(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("validateAssertion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.validate_assertion_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs b/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs index d3abd14f194..948c99eabda 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] pub type RtcIdentityProviderDetails; + #[wasm_bindgen(method, setter = "domain")] + fn domain_shim(this: &RtcIdentityProviderDetails, val: &str); + #[wasm_bindgen(method, setter = "protocol")] + fn protocol_shim(this: &RtcIdentityProviderDetails, val: &str); } impl RtcIdentityProviderDetails { #[doc = "Construct a new `RtcIdentityProviderDetails`."] @@ -25,31 +29,14 @@ impl RtcIdentityProviderDetails { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] pub fn domain(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("domain"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.domain_shim(val); self } #[doc = "Change the `protocol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] pub fn protocol(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.protocol_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs b/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs index c73d05c27c6..b4ee75df20c 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] pub type RtcIdentityProviderOptions; + #[wasm_bindgen(method, setter = "peerIdentity")] + fn peer_identity_shim(this: &RtcIdentityProviderOptions, val: &str); + #[wasm_bindgen(method, setter = "protocol")] + fn protocol_shim(this: &RtcIdentityProviderOptions, val: &str); + #[wasm_bindgen(method, setter = "usernameHint")] + fn username_hint_shim(this: &RtcIdentityProviderOptions, val: &str); } impl RtcIdentityProviderOptions { #[doc = "Construct a new `RtcIdentityProviderOptions`."] @@ -24,51 +30,21 @@ impl RtcIdentityProviderOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] pub fn peer_identity(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("peerIdentity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.peer_identity_shim(val); self } #[doc = "Change the `protocol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] pub fn protocol(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.protocol_shim(val); self } #[doc = "Change the `usernameHint` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] pub fn username_hint(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usernameHint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.username_hint_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs b/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs index f383349d7fb..3c86139a6e4 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] pub type RtcIdentityValidationResult; + #[wasm_bindgen(method, setter = "contents")] + fn contents_shim(this: &RtcIdentityValidationResult, val: &str); + #[wasm_bindgen(method, setter = "identity")] + fn identity_shim(this: &RtcIdentityValidationResult, val: &str); } impl RtcIdentityValidationResult { #[doc = "Construct a new `RtcIdentityValidationResult`."] @@ -26,34 +30,14 @@ impl RtcIdentityValidationResult { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] pub fn contents(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contents"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.contents_shim(val); self } #[doc = "Change the `identity` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] pub fn identity(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("identity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.identity_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs b/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs index c0d440f24cd..4d8ff7ecc6c 100644 --- a/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs @@ -10,6 +10,55 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub type RtcInboundRtpStreamStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcInboundRtpStreamStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "bitrateMean")] + fn bitrate_mean_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "bitrateStdDev")] + fn bitrate_std_dev_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "codecId")] + fn codec_id_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "firCount")] + fn fir_count_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "framerateMean")] + fn framerate_mean_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "framerateStdDev")] + fn framerate_std_dev_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "isRemote")] + fn is_remote_shim(this: &RtcInboundRtpStreamStats, val: bool); + #[wasm_bindgen(method, setter = "mediaTrackId")] + fn media_track_id_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "mediaType")] + fn media_type_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "nackCount")] + fn nack_count_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "pliCount")] + fn pli_count_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "remoteId")] + fn remote_id_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "ssrc")] + fn ssrc_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "transportId")] + fn transport_id_shim(this: &RtcInboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "bytesReceived")] + fn bytes_received_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "discardedPackets")] + fn discarded_packets_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "framesDecoded")] + fn frames_decoded_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "jitter")] + fn jitter_shim(this: &RtcInboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "packetsLost")] + fn packets_lost_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "packetsReceived")] + fn packets_received_shim(this: &RtcInboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "roundTripTime")] + fn round_trip_time_shim(this: &RtcInboundRtpStreamStats, val: i32); } impl RtcInboundRtpStreamStats { #[doc = "Construct a new `RtcInboundRtpStreamStats`."] @@ -24,30 +73,14 @@ impl RtcInboundRtpStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,363 +88,154 @@ impl RtcInboundRtpStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `bitrateMean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn bitrate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_mean_shim(val); self } #[doc = "Change the `bitrateStdDev` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_std_dev_shim(val); self } #[doc = "Change the `codecId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn codec_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_id_shim(val); self } #[doc = "Change the `firCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn fir_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("firCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fir_count_shim(val); self } #[doc = "Change the `framerateMean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn framerate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_mean_shim(val); self } #[doc = "Change the `framerateStdDev` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_std_dev_shim(val); self } #[doc = "Change the `isRemote` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn is_remote(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRemote"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_remote_shim(val); self } #[doc = "Change the `mediaTrackId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn media_track_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaTrackId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_track_id_shim(val); self } #[doc = "Change the `mediaType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn media_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_type_shim(val); self } #[doc = "Change the `nackCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn nack_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nackCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.nack_count_shim(val); self } #[doc = "Change the `pliCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn pli_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pliCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pli_count_shim(val); self } #[doc = "Change the `remoteId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn remote_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_id_shim(val); self } #[doc = "Change the `ssrc` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn ssrc(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_shim(val); self } #[doc = "Change the `transportId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_id_shim(val); self } #[doc = "Change the `bytesReceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn bytes_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_received_shim(val); self } #[doc = "Change the `discardedPackets` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn discarded_packets(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("discardedPackets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.discarded_packets_shim(val); self } #[doc = "Change the `framesDecoded` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn frames_decoded(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesDecoded"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_decoded_shim(val); self } #[doc = "Change the `jitter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn jitter(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("jitter"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.jitter_shim(val); self } #[doc = "Change the `packetsLost` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn packets_lost(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsLost"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.packets_lost_shim(val); self } #[doc = "Change the `packetsReceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn packets_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.packets_received_shim(val); self } #[doc = "Change the `roundTripTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub fn round_trip_time(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("roundTripTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.round_trip_time_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs b/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs index 2698c8a726a..3ee36c181b7 100644 --- a/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] pub type RtcMediaStreamStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcMediaStreamStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcMediaStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcMediaStreamStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "streamIdentifier")] + fn stream_identifier_shim(this: &RtcMediaStreamStats, val: &str); + #[wasm_bindgen(method, setter = "trackIds")] + fn track_ids_shim(this: &RtcMediaStreamStats, val: &::wasm_bindgen::JsValue); } impl RtcMediaStreamStats { #[doc = "Construct a new `RtcMediaStreamStats`."] @@ -24,30 +35,14 @@ impl RtcMediaStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,47 +50,21 @@ impl RtcMediaStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `streamIdentifier` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] pub fn stream_identifier(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streamIdentifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stream_identifier_shim(val); self } #[doc = "Change the `trackIds` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] pub fn track_ids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("trackIds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.track_ids_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs b/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs index 270dacf30ac..81b5fd0deda 100644 --- a/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs +++ b/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs @@ -10,6 +10,41 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub type RtcMediaStreamTrackStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcMediaStreamTrackStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcMediaStreamTrackStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcMediaStreamTrackStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "audioLevel")] + fn audio_level_shim(this: &RtcMediaStreamTrackStats, val: f64); + #[wasm_bindgen(method, setter = "echoReturnLoss")] + fn echo_return_loss_shim(this: &RtcMediaStreamTrackStats, val: f64); + #[wasm_bindgen(method, setter = "echoReturnLossEnhancement")] + fn echo_return_loss_enhancement_shim(this: &RtcMediaStreamTrackStats, val: f64); + #[wasm_bindgen(method, setter = "frameHeight")] + fn frame_height_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "frameWidth")] + fn frame_width_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "framesCorrupted")] + fn frames_corrupted_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "framesDecoded")] + fn frames_decoded_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "framesDropped")] + fn frames_dropped_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "framesPerSecond")] + fn frames_per_second_shim(this: &RtcMediaStreamTrackStats, val: f64); + #[wasm_bindgen(method, setter = "framesReceived")] + fn frames_received_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "framesSent")] + fn frames_sent_shim(this: &RtcMediaStreamTrackStats, val: u32); + #[wasm_bindgen(method, setter = "remoteSource")] + fn remote_source_shim(this: &RtcMediaStreamTrackStats, val: bool); + #[wasm_bindgen(method, setter = "ssrcIds")] + fn ssrc_ids_shim(this: &RtcMediaStreamTrackStats, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "trackIdentifier")] + fn track_identifier_shim(this: &RtcMediaStreamTrackStats, val: &str); } impl RtcMediaStreamTrackStats { #[doc = "Construct a new `RtcMediaStreamTrackStats`."] @@ -24,30 +59,14 @@ impl RtcMediaStreamTrackStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,251 +74,105 @@ impl RtcMediaStreamTrackStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `audioLevel` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_level_shim(val); self } #[doc = "Change the `echoReturnLoss` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn echo_return_loss(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoReturnLoss"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.echo_return_loss_shim(val); self } #[doc = "Change the `echoReturnLossEnhancement` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn echo_return_loss_enhancement(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoReturnLossEnhancement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.echo_return_loss_enhancement_shim(val); self } #[doc = "Change the `frameHeight` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frame_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_height_shim(val); self } #[doc = "Change the `frameWidth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frame_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_width_shim(val); self } #[doc = "Change the `framesCorrupted` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frames_corrupted(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesCorrupted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_corrupted_shim(val); self } #[doc = "Change the `framesDecoded` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frames_decoded(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesDecoded"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_decoded_shim(val); self } #[doc = "Change the `framesDropped` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frames_dropped(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesDropped"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_dropped_shim(val); self } #[doc = "Change the `framesPerSecond` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frames_per_second(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_per_second_shim(val); self } #[doc = "Change the `framesReceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frames_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_received_shim(val); self } #[doc = "Change the `framesSent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn frames_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_sent_shim(val); self } #[doc = "Change the `remoteSource` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn remote_source(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_source_shim(val); self } #[doc = "Change the `ssrcIds` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn ssrc_ids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ssrcIds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_ids_shim(val); self } #[doc = "Change the `trackIdentifier` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub fn track_identifier(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("trackIdentifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.track_identifier_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcOfferOptions.rs b/crates/web-sys/src/features/gen_RtcOfferOptions.rs index 353f369851b..11082e23695 100644 --- a/crates/web-sys/src/features/gen_RtcOfferOptions.rs +++ b/crates/web-sys/src/features/gen_RtcOfferOptions.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] pub type RtcOfferOptions; + #[wasm_bindgen(method, setter = "iceRestart")] + fn ice_restart_shim(this: &RtcOfferOptions, val: bool); + #[wasm_bindgen(method, setter = "offerToReceiveAudio")] + fn offer_to_receive_audio_shim(this: &RtcOfferOptions, val: bool); + #[wasm_bindgen(method, setter = "offerToReceiveVideo")] + fn offer_to_receive_video_shim(this: &RtcOfferOptions, val: bool); } impl RtcOfferOptions { #[doc = "Construct a new `RtcOfferOptions`."] @@ -24,51 +30,21 @@ impl RtcOfferOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] pub fn ice_restart(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceRestart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_restart_shim(val); self } #[doc = "Change the `offerToReceiveAudio` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] pub fn offer_to_receive_audio(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("offerToReceiveAudio"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offer_to_receive_audio_shim(val); self } #[doc = "Change the `offerToReceiveVideo` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] pub fn offer_to_receive_video(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("offerToReceiveVideo"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offer_to_receive_video_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs b/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs index 8e705281e44..34881d1b56f 100644 --- a/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs @@ -10,6 +10,51 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub type RtcOutboundRtpStreamStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcOutboundRtpStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcOutboundRtpStreamStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "bitrateMean")] + fn bitrate_mean_shim(this: &RtcOutboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "bitrateStdDev")] + fn bitrate_std_dev_shim(this: &RtcOutboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "codecId")] + fn codec_id_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "firCount")] + fn fir_count_shim(this: &RtcOutboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "framerateMean")] + fn framerate_mean_shim(this: &RtcOutboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "framerateStdDev")] + fn framerate_std_dev_shim(this: &RtcOutboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "isRemote")] + fn is_remote_shim(this: &RtcOutboundRtpStreamStats, val: bool); + #[wasm_bindgen(method, setter = "mediaTrackId")] + fn media_track_id_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "mediaType")] + fn media_type_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "nackCount")] + fn nack_count_shim(this: &RtcOutboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "pliCount")] + fn pli_count_shim(this: &RtcOutboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "remoteId")] + fn remote_id_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "ssrc")] + fn ssrc_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "transportId")] + fn transport_id_shim(this: &RtcOutboundRtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "bytesSent")] + fn bytes_sent_shim(this: &RtcOutboundRtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "droppedFrames")] + fn dropped_frames_shim(this: &RtcOutboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "framesEncoded")] + fn frames_encoded_shim(this: &RtcOutboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "packetsSent")] + fn packets_sent_shim(this: &RtcOutboundRtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "targetBitrate")] + fn target_bitrate_shim(this: &RtcOutboundRtpStreamStats, val: f64); } impl RtcOutboundRtpStreamStats { #[doc = "Construct a new `RtcOutboundRtpStreamStats`."] @@ -24,30 +69,14 @@ impl RtcOutboundRtpStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,332 +84,140 @@ impl RtcOutboundRtpStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `bitrateMean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn bitrate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_mean_shim(val); self } #[doc = "Change the `bitrateStdDev` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_std_dev_shim(val); self } #[doc = "Change the `codecId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn codec_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_id_shim(val); self } #[doc = "Change the `firCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn fir_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("firCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fir_count_shim(val); self } #[doc = "Change the `framerateMean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn framerate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_mean_shim(val); self } #[doc = "Change the `framerateStdDev` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_std_dev_shim(val); self } #[doc = "Change the `isRemote` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn is_remote(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRemote"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_remote_shim(val); self } #[doc = "Change the `mediaTrackId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn media_track_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaTrackId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_track_id_shim(val); self } #[doc = "Change the `mediaType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn media_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_type_shim(val); self } #[doc = "Change the `nackCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn nack_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nackCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.nack_count_shim(val); self } #[doc = "Change the `pliCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn pli_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pliCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pli_count_shim(val); self } #[doc = "Change the `remoteId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn remote_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_id_shim(val); self } #[doc = "Change the `ssrc` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn ssrc(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_shim(val); self } #[doc = "Change the `transportId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_id_shim(val); self } #[doc = "Change the `bytesSent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn bytes_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_sent_shim(val); self } #[doc = "Change the `droppedFrames` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn dropped_frames(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("droppedFrames"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dropped_frames_shim(val); self } #[doc = "Change the `framesEncoded` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn frames_encoded(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesEncoded"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frames_encoded_shim(val); self } #[doc = "Change the `packetsSent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn packets_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.packets_sent_shim(val); self } #[doc = "Change the `targetBitrate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub fn target_bitrate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targetBitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.target_bitrate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs b/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs index 26d98c9964c..b82a2c9e22e 100644 --- a/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] pub type RtcPeerConnectionIceEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &RtcPeerConnectionIceEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &RtcPeerConnectionIceEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &RtcPeerConnectionIceEventInit, val: bool); + #[cfg(feature = "RtcIceCandidate")] + #[wasm_bindgen(method, setter = "candidate")] + fn candidate_shim(this: &RtcPeerConnectionIceEventInit, val: Option<&RtcIceCandidate>); } impl RtcPeerConnectionIceEventInit { #[doc = "Construct a new `RtcPeerConnectionIceEventInit`."] @@ -24,51 +33,21 @@ impl RtcPeerConnectionIceEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "RtcIceCandidate")] @@ -76,17 +55,7 @@ impl RtcPeerConnectionIceEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidate`, `RtcPeerConnectionIceEventInit`*"] pub fn candidate(&mut self, val: Option<&RtcIceCandidate>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.candidate_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtcpParameters.rs b/crates/web-sys/src/features/gen_RtcRtcpParameters.rs index 8a84dff0427..37fa913401f 100644 --- a/crates/web-sys/src/features/gen_RtcRtcpParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtcpParameters.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] pub type RtcRtcpParameters; + #[wasm_bindgen(method, setter = "cname")] + fn cname_shim(this: &RtcRtcpParameters, val: &str); + #[wasm_bindgen(method, setter = "reducedSize")] + fn reduced_size_shim(this: &RtcRtcpParameters, val: bool); } impl RtcRtcpParameters { #[doc = "Construct a new `RtcRtcpParameters`."] @@ -24,30 +28,14 @@ impl RtcRtcpParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] pub fn cname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cname"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cname_shim(val); self } #[doc = "Change the `reducedSize` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] pub fn reduced_size(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reducedSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reduced_size_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs b/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs index 872d90d0bd6..b0b0fa4f9de 100644 --- a/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs +++ b/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] pub type RtcRtpCapabilities; + #[wasm_bindgen(method, setter = "codecs")] + fn codecs_shim(this: &RtcRtpCapabilities, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "headerExtensions")] + fn header_extensions_shim(this: &RtcRtpCapabilities, val: &::wasm_bindgen::JsValue); } impl RtcRtpCapabilities { #[doc = "Construct a new `RtcRtpCapabilities`."] @@ -29,31 +33,14 @@ impl RtcRtpCapabilities { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] pub fn codecs(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codecs"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codecs_shim(val); self } #[doc = "Change the `headerExtensions` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] pub fn header_extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headerExtensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.header_extensions_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs b/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs index 1b8730d70b9..1e229356986 100644 --- a/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs +++ b/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] pub type RtcRtpCodecCapability; + #[wasm_bindgen(method, setter = "channels")] + fn channels_shim(this: &RtcRtpCodecCapability, val: u16); + #[wasm_bindgen(method, setter = "clockRate")] + fn clock_rate_shim(this: &RtcRtpCodecCapability, val: u32); + #[wasm_bindgen(method, setter = "mimeType")] + fn mime_type_shim(this: &RtcRtpCodecCapability, val: &str); + #[wasm_bindgen(method, setter = "sdpFmtpLine")] + fn sdp_fmtp_line_shim(this: &RtcRtpCodecCapability, val: &str); } impl RtcRtpCodecCapability { #[doc = "Construct a new `RtcRtpCodecCapability`."] @@ -26,68 +34,28 @@ impl RtcRtpCodecCapability { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] pub fn channels(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channels_shim(val); self } #[doc = "Change the `clockRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] pub fn clock_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clockRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clock_rate_shim(val); self } #[doc = "Change the `mimeType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] pub fn mime_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mime_type_shim(val); self } #[doc = "Change the `sdpFmtpLine` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sdpFmtpLine"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sdp_fmtp_line_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs b/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs index 35d31c23db6..0293a310175 100644 --- a/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub type RtcRtpCodecParameters; + #[wasm_bindgen(method, setter = "channels")] + fn channels_shim(this: &RtcRtpCodecParameters, val: u16); + #[wasm_bindgen(method, setter = "clockRate")] + fn clock_rate_shim(this: &RtcRtpCodecParameters, val: u32); + #[wasm_bindgen(method, setter = "mimeType")] + fn mime_type_shim(this: &RtcRtpCodecParameters, val: &str); + #[wasm_bindgen(method, setter = "payloadType")] + fn payload_type_shim(this: &RtcRtpCodecParameters, val: u16); + #[wasm_bindgen(method, setter = "sdpFmtpLine")] + fn sdp_fmtp_line_shim(this: &RtcRtpCodecParameters, val: &str); } impl RtcRtpCodecParameters { #[doc = "Construct a new `RtcRtpCodecParameters`."] @@ -24,85 +34,35 @@ impl RtcRtpCodecParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub fn channels(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channels"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channels_shim(val); self } #[doc = "Change the `clockRate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub fn clock_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clockRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clock_rate_shim(val); self } #[doc = "Change the `mimeType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub fn mime_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mime_type_shim(val); self } #[doc = "Change the `payloadType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub fn payload_type(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("payloadType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.payload_type_shim(val); self } #[doc = "Change the `sdpFmtpLine` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sdpFmtpLine"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sdp_fmtp_line_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs b/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs index 77ee8c57050..5cec0c96708 100644 --- a/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs +++ b/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] pub type RtcRtpContributingSource; + #[wasm_bindgen(method, setter = "audioLevel")] + fn audio_level_shim(this: &RtcRtpContributingSource, val: f64); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &RtcRtpContributingSource, val: u32); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcRtpContributingSource, val: f64); } impl RtcRtpContributingSource { #[doc = "Construct a new `RtcRtpContributingSource`."] @@ -26,48 +32,21 @@ impl RtcRtpContributingSource { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_level_shim(val); self } #[doc = "Change the `source` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] pub fn source(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs b/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs index 4bafe39090c..1c8e1ed3b00 100644 --- a/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs @@ -10,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub type RtcRtpEncodingParameters; + #[wasm_bindgen(method, setter = "active")] + fn active_shim(this: &RtcRtpEncodingParameters, val: bool); + #[cfg(feature = "RtcDegradationPreference")] + #[wasm_bindgen(method, setter = "degradationPreference")] + fn degradation_preference_shim(this: &RtcRtpEncodingParameters, val: RtcDegradationPreference); + #[cfg(feature = "RtcFecParameters")] + #[wasm_bindgen(method, setter = "fec")] + fn fec_shim(this: &RtcRtpEncodingParameters, val: &RtcFecParameters); + #[wasm_bindgen(method, setter = "maxBitrate")] + fn max_bitrate_shim(this: &RtcRtpEncodingParameters, val: u32); + #[cfg(feature = "RtcPriorityType")] + #[wasm_bindgen(method, setter = "priority")] + fn priority_shim(this: &RtcRtpEncodingParameters, val: RtcPriorityType); + #[wasm_bindgen(method, setter = "rid")] + fn rid_shim(this: &RtcRtpEncodingParameters, val: &str); + #[cfg(feature = "RtcRtxParameters")] + #[wasm_bindgen(method, setter = "rtx")] + fn rtx_shim(this: &RtcRtpEncodingParameters, val: &RtcRtxParameters); + #[wasm_bindgen(method, setter = "scalabilityMode")] + fn scalability_mode_shim(this: &RtcRtpEncodingParameters, val: &str); + #[wasm_bindgen(method, setter = "scaleResolutionDownBy")] + fn scale_resolution_down_by_shim(this: &RtcRtpEncodingParameters, val: f32); + #[wasm_bindgen(method, setter = "ssrc")] + fn ssrc_shim(this: &RtcRtpEncodingParameters, val: u32); } impl RtcRtpEncodingParameters { #[doc = "Construct a new `RtcRtpEncodingParameters`."] @@ -24,14 +48,7 @@ impl RtcRtpEncodingParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub fn active(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.active_shim(val); self } #[cfg(feature = "RtcDegradationPreference")] @@ -39,17 +56,7 @@ impl RtcRtpEncodingParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"] pub fn degradation_preference(&mut self, val: RtcDegradationPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("degradationPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.degradation_preference_shim(val); self } #[cfg(feature = "RtcFecParameters")] @@ -57,30 +64,14 @@ impl RtcRtpEncodingParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"] pub fn fec(&mut self, val: &RtcFecParameters) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fec_shim(val); self } #[doc = "Change the `maxBitrate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub fn max_bitrate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxBitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.max_bitrate_shim(val); self } #[cfg(feature = "RtcPriorityType")] @@ -88,30 +79,14 @@ impl RtcRtpEncodingParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"] pub fn priority(&mut self, val: RtcPriorityType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.priority_shim(val); self } #[doc = "Change the `rid` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub fn rid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rid_shim(val); self } #[cfg(feature = "RtcRtxParameters")] @@ -119,13 +94,7 @@ impl RtcRtpEncodingParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"] pub fn rtx(&mut self, val: &RtcRtxParameters) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtx"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rtx_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -136,47 +105,21 @@ impl RtcRtpEncodingParameters { #[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 scalability_mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scalabilityMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scalability_mode_shim(val); self } #[doc = "Change the `scaleResolutionDownBy` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub fn scale_resolution_down_by(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scaleResolutionDownBy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scale_resolution_down_by_shim(val); self } #[doc = "Change the `ssrc` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub fn ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs index de9ec55990f..3a263a719e0 100644 --- a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs +++ b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] pub type RtcRtpHeaderExtensionCapability; + #[wasm_bindgen(method, setter = "uri")] + fn uri_shim(this: &RtcRtpHeaderExtensionCapability, val: &str); } impl RtcRtpHeaderExtensionCapability { #[doc = "Construct a new `RtcRtpHeaderExtensionCapability`."] @@ -25,13 +27,7 @@ impl RtcRtpHeaderExtensionCapability { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] pub fn uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uri"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.uri_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs index bd1a3634ef1..bd09da10daf 100644 --- a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] pub type RtcRtpHeaderExtensionParameters; + #[wasm_bindgen(method, setter = "encrypted")] + fn encrypted_shim(this: &RtcRtpHeaderExtensionParameters, val: bool); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcRtpHeaderExtensionParameters, val: u16); + #[wasm_bindgen(method, setter = "uri")] + fn uri_shim(this: &RtcRtpHeaderExtensionParameters, val: &str); } impl RtcRtpHeaderExtensionParameters { #[doc = "Construct a new `RtcRtpHeaderExtensionParameters`."] @@ -24,43 +30,21 @@ impl RtcRtpHeaderExtensionParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] pub fn encrypted(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encrypted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.encrypted_shim(val); self } #[doc = "Change the `id` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] pub fn id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `uri` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] pub fn uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uri"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.uri_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpParameters.rs b/crates/web-sys/src/features/gen_RtcRtpParameters.rs index 65d7e31046d..1b260e0ea55 100644 --- a/crates/web-sys/src/features/gen_RtcRtpParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpParameters.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] pub type RtcRtpParameters; + #[wasm_bindgen(method, setter = "codecs")] + fn codecs_shim(this: &RtcRtpParameters, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "encodings")] + fn encodings_shim(this: &RtcRtpParameters, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "headerExtensions")] + fn header_extensions_shim(this: &RtcRtpParameters, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "RtcRtcpParameters")] + #[wasm_bindgen(method, setter = "rtcp")] + fn rtcp_shim(this: &RtcRtpParameters, val: &RtcRtcpParameters); } impl RtcRtpParameters { #[doc = "Construct a new `RtcRtpParameters`."] @@ -24,48 +33,21 @@ impl RtcRtpParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] pub fn codecs(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codecs"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codecs_shim(val); self } #[doc = "Change the `encodings` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] pub fn encodings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encodings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.encodings_shim(val); self } #[doc = "Change the `headerExtensions` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] pub fn header_extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headerExtensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.header_extensions_shim(val); self } #[cfg(feature = "RtcRtcpParameters")] @@ -73,13 +55,7 @@ impl RtcRtpParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`, `RtcRtpParameters`*"] pub fn rtcp(&mut self, val: &RtcRtcpParameters) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtcp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rtcp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs b/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs index 6c4082958a8..3983d4b3827 100644 --- a/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs +++ b/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] pub type RtcRtpSourceEntry; + #[wasm_bindgen(method, setter = "audioLevel")] + fn audio_level_shim(this: &RtcRtpSourceEntry, val: f64); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &RtcRtpSourceEntry, val: u32); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcRtpSourceEntry, val: f64); + #[wasm_bindgen(method, setter = "voiceActivityFlag")] + fn voice_activity_flag_shim(this: &RtcRtpSourceEntry, val: Option); + #[cfg(feature = "RtcRtpSourceEntryType")] + #[wasm_bindgen(method, setter = "sourceType")] + fn source_type_shim(this: &RtcRtpSourceEntry, val: RtcRtpSourceEntryType); } impl RtcRtpSourceEntry { #[cfg(feature = "RtcRtpSourceEntryType")] @@ -28,65 +39,28 @@ impl RtcRtpSourceEntry { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_level_shim(val); self } #[doc = "Change the `source` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] pub fn source(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[doc = "Change the `voiceActivityFlag` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] pub fn voice_activity_flag(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("voiceActivityFlag"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.voice_activity_flag_shim(val); self } #[cfg(feature = "RtcRtpSourceEntryType")] @@ -94,17 +68,7 @@ impl RtcRtpSourceEntry { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"] pub fn source_type(&mut self, val: RtcRtpSourceEntryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_type_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs b/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs index caf4d6e34fa..3b58feee346 100644 --- a/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs +++ b/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] pub type RtcRtpSynchronizationSource; + #[wasm_bindgen(method, setter = "audioLevel")] + fn audio_level_shim(this: &RtcRtpSynchronizationSource, val: f64); + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &RtcRtpSynchronizationSource, val: u32); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcRtpSynchronizationSource, val: f64); + #[wasm_bindgen(method, setter = "voiceActivityFlag")] + fn voice_activity_flag_shim(this: &RtcRtpSynchronizationSource, val: Option); } impl RtcRtpSynchronizationSource { #[doc = "Construct a new `RtcRtpSynchronizationSource`."] @@ -26,65 +34,28 @@ impl RtcRtpSynchronizationSource { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.audio_level_shim(val); self } #[doc = "Change the `source` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] pub fn source(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[doc = "Change the `voiceActivityFlag` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] pub fn voice_activity_flag(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("voiceActivityFlag"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.voice_activity_flag_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs b/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs index f54384bb0df..47fbc05961d 100644 --- a/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs +++ b/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] pub type RtcRtpTransceiverInit; + #[cfg(feature = "RtcRtpTransceiverDirection")] + #[wasm_bindgen(method, setter = "direction")] + fn direction_shim(this: &RtcRtpTransceiverInit, val: RtcRtpTransceiverDirection); + #[wasm_bindgen(method, setter = "sendEncodings")] + fn send_encodings_shim(this: &RtcRtpTransceiverInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "streams")] + fn streams_shim(this: &RtcRtpTransceiverInit, val: &::wasm_bindgen::JsValue); } impl RtcRtpTransceiverInit { #[doc = "Construct a new `RtcRtpTransceiverInit`."] @@ -25,51 +32,21 @@ impl RtcRtpTransceiverInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverDirection`, `RtcRtpTransceiverInit`*"] pub fn direction(&mut self, val: RtcRtpTransceiverDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.direction_shim(val); self } #[doc = "Change the `sendEncodings` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] pub fn send_encodings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sendEncodings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.send_encodings_shim(val); self } #[doc = "Change the `streams` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] pub fn streams(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.streams_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtxParameters.rs b/crates/web-sys/src/features/gen_RtcRtxParameters.rs index fd184ac827a..29aba89a545 100644 --- a/crates/web-sys/src/features/gen_RtcRtxParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtxParameters.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtxParameters`*"] pub type RtcRtxParameters; + #[wasm_bindgen(method, setter = "ssrc")] + fn ssrc_shim(this: &RtcRtxParameters, val: u32); } impl RtcRtxParameters { #[doc = "Construct a new `RtcRtxParameters`."] @@ -24,13 +26,7 @@ impl RtcRtxParameters { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtxParameters`*"] pub fn ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs b/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs index 5b2af20278c..e0b20763b49 100644 --- a/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs +++ b/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"] pub type RtcSessionDescriptionInit; + #[wasm_bindgen(method, setter = "sdp")] + fn sdp_shim(this: &RtcSessionDescriptionInit, val: &str); + #[cfg(feature = "RtcSdpType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcSessionDescriptionInit, val: RtcSdpType); } impl RtcSessionDescriptionInit { #[cfg(feature = "RtcSdpType")] @@ -26,13 +31,7 @@ impl RtcSessionDescriptionInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"] pub fn sdp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sdp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sdp_shim(val); self } #[cfg(feature = "RtcSdpType")] @@ -40,13 +39,7 @@ impl RtcSessionDescriptionInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"] pub fn type_(&mut self, val: RtcSdpType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcStats.rs b/crates/web-sys/src/features/gen_RtcStats.rs index 2a3435a2edf..ecbb178de3f 100644 --- a/crates/web-sys/src/features/gen_RtcStats.rs +++ b/crates/web-sys/src/features/gen_RtcStats.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] pub type RtcStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcStats, val: RtcStatsType); } impl RtcStats { #[doc = "Construct a new `RtcStats`."] @@ -24,30 +31,14 @@ impl RtcStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,13 +46,7 @@ impl RtcStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStats`, `RtcStatsType`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs b/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs index 8bdb3b8e931..a08365bf1a0 100644 --- a/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs +++ b/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs @@ -10,6 +10,54 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub type RtcStatsReportInternal; + #[wasm_bindgen(method, setter = "closed")] + fn closed_shim(this: &RtcStatsReportInternal, val: bool); + #[wasm_bindgen(method, setter = "codecStats")] + fn codec_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "iceCandidatePairStats")] + fn ice_candidate_pair_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "iceCandidateStats")] + fn ice_candidate_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "iceComponentStats")] + fn ice_component_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "iceRestarts")] + fn ice_restarts_shim(this: &RtcStatsReportInternal, val: u32); + #[wasm_bindgen(method, setter = "iceRollbacks")] + fn ice_rollbacks_shim(this: &RtcStatsReportInternal, val: u32); + #[wasm_bindgen(method, setter = "inboundRTPStreamStats")] + fn inbound_rtp_stream_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "localSdp")] + fn local_sdp_shim(this: &RtcStatsReportInternal, val: &str); + #[wasm_bindgen(method, setter = "mediaStreamStats")] + fn media_stream_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "mediaStreamTrackStats")] + fn media_stream_track_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "offerer")] + fn offerer_shim(this: &RtcStatsReportInternal, val: bool); + #[wasm_bindgen(method, setter = "outboundRTPStreamStats")] + fn outbound_rtp_stream_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "pcid")] + fn pcid_shim(this: &RtcStatsReportInternal, val: &str); + #[wasm_bindgen(method, setter = "rawLocalCandidates")] + fn raw_local_candidates_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "rawRemoteCandidates")] + fn raw_remote_candidates_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "remoteSdp")] + fn remote_sdp_shim(this: &RtcStatsReportInternal, val: &str); + #[wasm_bindgen(method, setter = "rtpContributingSourceStats")] + fn rtp_contributing_source_stats_shim( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcStatsReportInternal, val: f64); + #[wasm_bindgen(method, setter = "transportStats")] + fn transport_stats_shim(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "trickledIceCandidateStats")] + fn trickled_ice_candidate_stats_shim( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); } impl RtcStatsReportInternal { #[doc = "Construct a new `RtcStatsReportInternal`."] @@ -24,350 +72,147 @@ impl RtcStatsReportInternal { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn closed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("closed"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.closed_shim(val); self } #[doc = "Change the `codecStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn codec_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_stats_shim(val); self } #[doc = "Change the `iceCandidatePairStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn ice_candidate_pair_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceCandidatePairStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_candidate_pair_stats_shim(val); self } #[doc = "Change the `iceCandidateStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn ice_candidate_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceCandidateStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_candidate_stats_shim(val); self } #[doc = "Change the `iceComponentStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn ice_component_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceComponentStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_component_stats_shim(val); self } #[doc = "Change the `iceRestarts` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn ice_restarts(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceRestarts"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_restarts_shim(val); self } #[doc = "Change the `iceRollbacks` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn ice_rollbacks(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceRollbacks"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ice_rollbacks_shim(val); self } #[doc = "Change the `inboundRTPStreamStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn inbound_rtp_stream_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inboundRTPStreamStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.inbound_rtp_stream_stats_shim(val); self } #[doc = "Change the `localSdp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn local_sdp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localSdp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.local_sdp_shim(val); self } #[doc = "Change the `mediaStreamStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn media_stream_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaStreamStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_stream_stats_shim(val); self } #[doc = "Change the `mediaStreamTrackStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn media_stream_track_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaStreamTrackStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_stream_track_stats_shim(val); self } #[doc = "Change the `offerer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn offerer(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("offerer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.offerer_shim(val); self } #[doc = "Change the `outboundRTPStreamStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn outbound_rtp_stream_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("outboundRTPStreamStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.outbound_rtp_stream_stats_shim(val); self } #[doc = "Change the `pcid` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn pcid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pcid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pcid_shim(val); self } #[doc = "Change the `rawLocalCandidates` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn raw_local_candidates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rawLocalCandidates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.raw_local_candidates_shim(val); self } #[doc = "Change the `rawRemoteCandidates` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn raw_remote_candidates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rawRemoteCandidates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.raw_remote_candidates_shim(val); self } #[doc = "Change the `remoteSdp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn remote_sdp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteSdp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_sdp_shim(val); self } #[doc = "Change the `rtpContributingSourceStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn rtp_contributing_source_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rtpContributingSourceStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rtp_contributing_source_stats_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[doc = "Change the `transportStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn transport_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_stats_shim(val); self } #[doc = "Change the `trickledIceCandidateStats` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub fn trickled_ice_candidate_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("trickledIceCandidateStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.trickled_ice_candidate_stats_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcTrackEventInit.rs b/crates/web-sys/src/features/gen_RtcTrackEventInit.rs index 7bc6ce67d01..03ef80243d1 100644 --- a/crates/web-sys/src/features/gen_RtcTrackEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcTrackEventInit.rs @@ -10,6 +10,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] pub type RtcTrackEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &RtcTrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &RtcTrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &RtcTrackEventInit, val: bool); + #[cfg(feature = "RtcRtpReceiver")] + #[wasm_bindgen(method, setter = "receiver")] + fn receiver_shim(this: &RtcTrackEventInit, val: &RtcRtpReceiver); + #[wasm_bindgen(method, setter = "streams")] + fn streams_shim(this: &RtcTrackEventInit, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "MediaStreamTrack")] + #[wasm_bindgen(method, setter = "track")] + fn track_shim(this: &RtcTrackEventInit, val: &MediaStreamTrack); + #[cfg(feature = "RtcRtpTransceiver")] + #[wasm_bindgen(method, setter = "transceiver")] + fn transceiver_shim(this: &RtcTrackEventInit, val: &RtcRtpTransceiver); } impl RtcTrackEventInit { #[cfg(all( @@ -36,51 +53,21 @@ impl RtcTrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "RtcRtpReceiver")] @@ -88,34 +75,14 @@ impl RtcTrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcTrackEventInit`*"] pub fn receiver(&mut self, val: &RtcRtpReceiver) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("receiver"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.receiver_shim(val); self } #[doc = "Change the `streams` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] pub fn streams(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.streams_shim(val); self } #[cfg(feature = "MediaStreamTrack")] @@ -123,13 +90,7 @@ impl RtcTrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcTrackEventInit`*"] pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.track_shim(val); self } #[cfg(feature = "RtcRtpTransceiver")] @@ -137,17 +98,7 @@ impl RtcTrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`, `RtcTrackEventInit`*"] pub fn transceiver(&mut self, val: &RtcRtpTransceiver) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transceiver"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transceiver_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcTransportStats.rs b/crates/web-sys/src/features/gen_RtcTransportStats.rs index 93f9a818c63..d76e5bb3220 100644 --- a/crates/web-sys/src/features/gen_RtcTransportStats.rs +++ b/crates/web-sys/src/features/gen_RtcTransportStats.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] pub type RtcTransportStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcTransportStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcTransportStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcTransportStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "bytesReceived")] + fn bytes_received_shim(this: &RtcTransportStats, val: u32); + #[wasm_bindgen(method, setter = "bytesSent")] + fn bytes_sent_shim(this: &RtcTransportStats, val: u32); } impl RtcTransportStats { #[doc = "Construct a new `RtcTransportStats`."] @@ -24,30 +35,14 @@ impl RtcTransportStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,47 +50,21 @@ impl RtcTransportStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcTransportStats`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `bytesReceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] pub fn bytes_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_received_shim(val); self } #[doc = "Change the `bytesSent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] pub fn bytes_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_sent_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs b/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs index cd7ee92775f..5232911bd6a 100644 --- a/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] pub type RtcdtmfToneChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &RtcdtmfToneChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &RtcdtmfToneChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &RtcdtmfToneChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "tone")] + fn tone_shim(this: &RtcdtmfToneChangeEventInit, val: &str); } impl RtcdtmfToneChangeEventInit { #[doc = "Construct a new `RtcdtmfToneChangeEventInit`."] @@ -24,64 +32,28 @@ impl RtcdtmfToneChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `tone` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] pub fn tone(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tone"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tone_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs b/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs index 637fcd06fdb..76ba0860223 100644 --- a/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs +++ b/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] pub type RtcrtpContributingSourceStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcrtpContributingSourceStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcrtpContributingSourceStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcrtpContributingSourceStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "contributorSsrc")] + fn contributor_ssrc_shim(this: &RtcrtpContributingSourceStats, val: u32); + #[wasm_bindgen(method, setter = "inboundRtpStreamId")] + fn inbound_rtp_stream_id_shim(this: &RtcrtpContributingSourceStats, val: &str); } impl RtcrtpContributingSourceStats { #[doc = "Construct a new `RtcrtpContributingSourceStats`."] @@ -24,30 +35,14 @@ impl RtcrtpContributingSourceStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,47 +50,21 @@ impl RtcrtpContributingSourceStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpContributingSourceStats`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `contributorSsrc` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] pub fn contributor_ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contributorSsrc"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.contributor_ssrc_shim(val); self } #[doc = "Change the `inboundRtpStreamId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] pub fn inbound_rtp_stream_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inboundRtpStreamId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.inbound_rtp_stream_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs b/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs index 5d7650e0306..f33e1127499 100644 --- a/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs @@ -10,6 +10,41 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub type RtcrtpStreamStats; + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &RtcrtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &RtcrtpStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &RtcrtpStreamStats, val: RtcStatsType); + #[wasm_bindgen(method, setter = "bitrateMean")] + fn bitrate_mean_shim(this: &RtcrtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "bitrateStdDev")] + fn bitrate_std_dev_shim(this: &RtcrtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "codecId")] + fn codec_id_shim(this: &RtcrtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "firCount")] + fn fir_count_shim(this: &RtcrtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "framerateMean")] + fn framerate_mean_shim(this: &RtcrtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "framerateStdDev")] + fn framerate_std_dev_shim(this: &RtcrtpStreamStats, val: f64); + #[wasm_bindgen(method, setter = "isRemote")] + fn is_remote_shim(this: &RtcrtpStreamStats, val: bool); + #[wasm_bindgen(method, setter = "mediaTrackId")] + fn media_track_id_shim(this: &RtcrtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "mediaType")] + fn media_type_shim(this: &RtcrtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "nackCount")] + fn nack_count_shim(this: &RtcrtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "pliCount")] + fn pli_count_shim(this: &RtcrtpStreamStats, val: u32); + #[wasm_bindgen(method, setter = "remoteId")] + fn remote_id_shim(this: &RtcrtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "ssrc")] + fn ssrc_shim(this: &RtcrtpStreamStats, val: &str); + #[wasm_bindgen(method, setter = "transportId")] + fn transport_id_shim(this: &RtcrtpStreamStats, val: &str); } impl RtcrtpStreamStats { #[doc = "Construct a new `RtcrtpStreamStats`."] @@ -24,30 +59,14 @@ impl RtcrtpStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[doc = "Change the `timestamp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(feature = "RtcStatsType")] @@ -55,247 +74,105 @@ impl RtcrtpStreamStats { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpStreamStats`*"] pub fn type_(&mut self, val: RtcStatsType) -> &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.type__shim(val); self } #[doc = "Change the `bitrateMean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn bitrate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_mean_shim(val); self } #[doc = "Change the `bitrateStdDev` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_std_dev_shim(val); self } #[doc = "Change the `codecId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn codec_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_id_shim(val); self } #[doc = "Change the `firCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn fir_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("firCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fir_count_shim(val); self } #[doc = "Change the `framerateMean` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn framerate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_mean_shim(val); self } #[doc = "Change the `framerateStdDev` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_std_dev_shim(val); self } #[doc = "Change the `isRemote` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn is_remote(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRemote"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.is_remote_shim(val); self } #[doc = "Change the `mediaTrackId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn media_track_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaTrackId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_track_id_shim(val); self } #[doc = "Change the `mediaType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn media_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.media_type_shim(val); self } #[doc = "Change the `nackCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn nack_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nackCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.nack_count_shim(val); self } #[doc = "Change the `pliCount` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn pli_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pliCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pli_count_shim(val); self } #[doc = "Change the `remoteId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn remote_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_id_shim(val); self } #[doc = "Change the `ssrc` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn ssrc(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ssrc_shim(val); self } #[doc = "Change the `transportId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transport_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs b/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs index 46530763c59..9502619bfac 100644 --- a/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs +++ b/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs @@ -14,6 +14,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 type SaveFilePickerOptions; + #[wasm_bindgen(method, setter = "excludeAcceptAllOption")] + fn exclude_accept_all_option_shim(this: &SaveFilePickerOptions, val: bool); + #[wasm_bindgen(method, setter = "id")] + fn id_shim(this: &SaveFilePickerOptions, val: &str); + #[wasm_bindgen(method, setter = "startIn")] + fn start_in_shim(this: &SaveFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "types")] + fn types_shim(this: &SaveFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "suggestedName")] + fn suggested_name_shim(this: &SaveFilePickerOptions, val: Option<&str>); } #[cfg(web_sys_unstable_apis)] impl SaveFilePickerOptions { @@ -36,17 +46,7 @@ impl SaveFilePickerOptions { #[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 exclude_accept_all_option(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("excludeAcceptAllOption"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.exclude_accept_all_option_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +57,7 @@ impl SaveFilePickerOptions { #[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 id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +68,7 @@ impl SaveFilePickerOptions { #[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 start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startIn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.start_in_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,13 +79,7 @@ impl SaveFilePickerOptions { #[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 types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("types"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.types_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -112,17 +90,7 @@ impl SaveFilePickerOptions { #[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 suggested_name(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("suggestedName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.suggested_name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs b/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs index d1e8818cb04..a913bd85edc 100644 --- a/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs +++ b/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs @@ -14,6 +14,14 @@ 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 type SchedulerPostTaskOptions; + #[wasm_bindgen(method, setter = "delay")] + fn delay_shim(this: &SchedulerPostTaskOptions, val: f64); + #[cfg(feature = "TaskPriority")] + #[wasm_bindgen(method, setter = "priority")] + fn priority_shim(this: &SchedulerPostTaskOptions, val: TaskPriority); + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &SchedulerPostTaskOptions, val: &AbortSignal); } #[cfg(web_sys_unstable_apis)] impl SchedulerPostTaskOptions { @@ -36,13 +44,7 @@ impl SchedulerPostTaskOptions { #[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 delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delay_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +56,7 @@ impl SchedulerPostTaskOptions { #[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 priority(&mut self, val: TaskPriority) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.priority_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -76,14 +68,7 @@ impl SchedulerPostTaskOptions { #[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 signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs b/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs index c5a65fa67c6..b412d88ad14 100644 --- a/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs +++ b/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`*"] pub type ScrollIntoViewOptions; + #[cfg(feature = "ScrollBehavior")] + #[wasm_bindgen(method, setter = "behavior")] + fn behavior_shim(this: &ScrollIntoViewOptions, val: ScrollBehavior); + #[cfg(feature = "ScrollLogicalPosition")] + #[wasm_bindgen(method, setter = "block")] + fn block_shim(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition); + #[cfg(feature = "ScrollLogicalPosition")] + #[wasm_bindgen(method, setter = "inline")] + fn inline_shim(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition); } impl ScrollIntoViewOptions { #[doc = "Construct a new `ScrollIntoViewOptions`."] @@ -25,17 +34,7 @@ impl ScrollIntoViewOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollIntoViewOptions`*"] pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("behavior"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.behavior_shim(val); self } #[cfg(feature = "ScrollLogicalPosition")] @@ -43,13 +42,7 @@ impl ScrollIntoViewOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] pub fn block(&mut self, val: ScrollLogicalPosition) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("block"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.block_shim(val); self } #[cfg(feature = "ScrollLogicalPosition")] @@ -57,14 +50,7 @@ impl ScrollIntoViewOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] pub fn inline(&mut self, val: ScrollLogicalPosition) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("inline"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.inline_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollOptions.rs b/crates/web-sys/src/features/gen_ScrollOptions.rs index 3f7a7443164..2357199aa50 100644 --- a/crates/web-sys/src/features/gen_ScrollOptions.rs +++ b/crates/web-sys/src/features/gen_ScrollOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollOptions`*"] pub type ScrollOptions; + #[cfg(feature = "ScrollBehavior")] + #[wasm_bindgen(method, setter = "behavior")] + fn behavior_shim(this: &ScrollOptions, val: ScrollBehavior); } impl ScrollOptions { #[doc = "Construct a new `ScrollOptions`."] @@ -25,17 +28,7 @@ impl ScrollOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollOptions`*"] pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("behavior"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.behavior_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollToOptions.rs b/crates/web-sys/src/features/gen_ScrollToOptions.rs index b42cac636e0..d529c5913a8 100644 --- a/crates/web-sys/src/features/gen_ScrollToOptions.rs +++ b/crates/web-sys/src/features/gen_ScrollToOptions.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] pub type ScrollToOptions; + #[cfg(feature = "ScrollBehavior")] + #[wasm_bindgen(method, setter = "behavior")] + fn behavior_shim(this: &ScrollToOptions, val: ScrollBehavior); + #[wasm_bindgen(method, setter = "left")] + fn left_shim(this: &ScrollToOptions, val: f64); + #[wasm_bindgen(method, setter = "top")] + fn top_shim(this: &ScrollToOptions, val: f64); } impl ScrollToOptions { #[doc = "Construct a new `ScrollToOptions`."] @@ -25,43 +32,21 @@ impl ScrollToOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollToOptions`*"] pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("behavior"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.behavior_shim(val); self } #[doc = "Change the `left` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] pub fn left(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("left"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.left_shim(val); self } #[doc = "Change the `top` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] pub fn top(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("top"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.top_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs b/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs index 26b1f09c22e..79eb87f27ec 100644 --- a/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] pub type ScrollViewChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ScrollViewChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ScrollViewChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ScrollViewChangeEventInit, val: bool); + #[cfg(feature = "ScrollState")] + #[wasm_bindgen(method, setter = "state")] + fn state_shim(this: &ScrollViewChangeEventInit, val: ScrollState); } impl ScrollViewChangeEventInit { #[doc = "Construct a new `ScrollViewChangeEventInit`."] @@ -24,51 +33,21 @@ impl ScrollViewChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "ScrollState")] @@ -76,13 +55,7 @@ impl ScrollViewChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollState`, `ScrollViewChangeEventInit`*"] pub fn state(&mut self, val: ScrollState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("state"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.state_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs b/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs index a51d4da0d5c..2f86bc879fb 100644 --- a/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs +++ b/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs @@ -10,6 +10,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub type SecurityPolicyViolationEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &SecurityPolicyViolationEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &SecurityPolicyViolationEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &SecurityPolicyViolationEventInit, val: bool); + #[wasm_bindgen(method, setter = "blockedURI")] + fn blocked_uri_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "columnNumber")] + fn column_number_shim(this: &SecurityPolicyViolationEventInit, val: i32); + #[cfg(feature = "SecurityPolicyViolationEventDisposition")] + #[wasm_bindgen(method, setter = "disposition")] + fn disposition_shim( + this: &SecurityPolicyViolationEventInit, + val: SecurityPolicyViolationEventDisposition, + ); + #[wasm_bindgen(method, setter = "documentURI")] + fn document_uri_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "effectiveDirective")] + fn effective_directive_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "lineNumber")] + fn line_number_shim(this: &SecurityPolicyViolationEventInit, val: i32); + #[wasm_bindgen(method, setter = "originalPolicy")] + fn original_policy_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "referrer")] + fn referrer_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "sample")] + fn sample_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "sourceFile")] + fn source_file_shim(this: &SecurityPolicyViolationEventInit, val: &str); + #[wasm_bindgen(method, setter = "statusCode")] + fn status_code_shim(this: &SecurityPolicyViolationEventInit, val: u16); + #[wasm_bindgen(method, setter = "violatedDirective")] + fn violated_directive_shim(this: &SecurityPolicyViolationEventInit, val: &str); } impl SecurityPolicyViolationEventInit { #[doc = "Construct a new `SecurityPolicyViolationEventInit`."] @@ -24,85 +58,35 @@ impl SecurityPolicyViolationEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `blockedURI` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn blocked_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("blockedURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.blocked_uri_shim(val); self } #[doc = "Change the `columnNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn column_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("columnNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.column_number_shim(val); self } #[cfg(feature = "SecurityPolicyViolationEventDisposition")] @@ -110,167 +94,70 @@ impl SecurityPolicyViolationEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventDisposition`, `SecurityPolicyViolationEventInit`*"] pub fn disposition(&mut self, val: SecurityPolicyViolationEventDisposition) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disposition"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.disposition_shim(val); self } #[doc = "Change the `documentURI` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn document_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("documentURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.document_uri_shim(val); self } #[doc = "Change the `effectiveDirective` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn effective_directive(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("effectiveDirective"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.effective_directive_shim(val); self } #[doc = "Change the `lineNumber` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn line_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lineNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.line_number_shim(val); self } #[doc = "Change the `originalPolicy` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn original_policy(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("originalPolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.original_policy_shim(val); self } #[doc = "Change the `referrer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn referrer(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.referrer_shim(val); self } #[doc = "Change the `sample` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn sample(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sample"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sample_shim(val); self } #[doc = "Change the `sourceFile` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn source_file(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceFile"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_file_shim(val); self } #[doc = "Change the `statusCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn status_code(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("statusCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.status_code_shim(val); self } #[doc = "Change the `violatedDirective` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub fn violated_directive(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("violatedDirective"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.violated_directive_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SerialInputSignals.rs b/crates/web-sys/src/features/gen_SerialInputSignals.rs index dce79b531ef..bac6b8f7679 100644 --- a/crates/web-sys/src/features/gen_SerialInputSignals.rs +++ b/crates/web-sys/src/features/gen_SerialInputSignals.rs @@ -14,6 +14,14 @@ 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 type SerialInputSignals; + #[wasm_bindgen(method, setter = "clearToSend")] + fn clear_to_send_shim(this: &SerialInputSignals, val: bool); + #[wasm_bindgen(method, setter = "dataCarrierDetect")] + fn data_carrier_detect_shim(this: &SerialInputSignals, val: bool); + #[wasm_bindgen(method, setter = "dataSetReady")] + fn data_set_ready_shim(this: &SerialInputSignals, val: bool); + #[wasm_bindgen(method, setter = "ringIndicator")] + fn ring_indicator_shim(this: &SerialInputSignals, val: bool); } #[cfg(web_sys_unstable_apis)] impl SerialInputSignals { @@ -45,17 +53,7 @@ impl SerialInputSignals { #[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 clear_to_send(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clearToSend"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clear_to_send_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -66,17 +64,7 @@ impl SerialInputSignals { #[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 data_carrier_detect(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataCarrierDetect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_carrier_detect_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -87,17 +75,7 @@ impl SerialInputSignals { #[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 data_set_ready(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataSetReady"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_set_ready_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -108,17 +86,7 @@ impl SerialInputSignals { #[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 ring_indicator(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ringIndicator"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ring_indicator_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SerialOptions.rs b/crates/web-sys/src/features/gen_SerialOptions.rs index 4f9f2b8e7d9..02b78361511 100644 --- a/crates/web-sys/src/features/gen_SerialOptions.rs +++ b/crates/web-sys/src/features/gen_SerialOptions.rs @@ -14,6 +14,20 @@ 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 type SerialOptions; + #[wasm_bindgen(method, setter = "baudRate")] + fn baud_rate_shim(this: &SerialOptions, val: u32); + #[wasm_bindgen(method, setter = "bufferSize")] + fn buffer_size_shim(this: &SerialOptions, val: u32); + #[wasm_bindgen(method, setter = "dataBits")] + fn data_bits_shim(this: &SerialOptions, val: u8); + #[cfg(feature = "FlowControlType")] + #[wasm_bindgen(method, setter = "flowControl")] + fn flow_control_shim(this: &SerialOptions, val: FlowControlType); + #[cfg(feature = "ParityType")] + #[wasm_bindgen(method, setter = "parity")] + fn parity_shim(this: &SerialOptions, val: ParityType); + #[wasm_bindgen(method, setter = "stopBits")] + fn stop_bits_shim(this: &SerialOptions, val: u8); } #[cfg(web_sys_unstable_apis)] impl SerialOptions { @@ -37,17 +51,7 @@ impl SerialOptions { #[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 baud_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baudRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.baud_rate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +62,7 @@ impl SerialOptions { #[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 buffer_size(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bufferSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buffer_size_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +73,7 @@ impl SerialOptions { #[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 data_bits(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataBits"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_bits_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -101,17 +85,7 @@ impl SerialOptions { #[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 flow_control(&mut self, val: FlowControlType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("flowControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.flow_control_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -123,14 +97,7 @@ impl SerialOptions { #[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 parity(&mut self, val: ParityType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("parity"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.parity_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -141,17 +108,7 @@ impl SerialOptions { #[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 stop_bits(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stopBits"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stop_bits_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SerialOutputSignals.rs b/crates/web-sys/src/features/gen_SerialOutputSignals.rs index 367e446ddaa..73b3fb9764a 100644 --- a/crates/web-sys/src/features/gen_SerialOutputSignals.rs +++ b/crates/web-sys/src/features/gen_SerialOutputSignals.rs @@ -14,6 +14,12 @@ 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 type SerialOutputSignals; + #[wasm_bindgen(method, setter = "break")] + fn break__shim(this: &SerialOutputSignals, val: bool); + #[wasm_bindgen(method, setter = "dataTerminalReady")] + fn data_terminal_ready_shim(this: &SerialOutputSignals, val: bool); + #[wasm_bindgen(method, setter = "requestToSend")] + fn request_to_send_shim(this: &SerialOutputSignals, val: bool); } #[cfg(web_sys_unstable_apis)] impl SerialOutputSignals { @@ -36,13 +42,7 @@ impl SerialOutputSignals { #[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 break_(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("break"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.break__shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,17 +53,7 @@ impl SerialOutputSignals { #[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 data_terminal_ready(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataTerminalReady"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_terminal_ready_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +64,7 @@ impl SerialOutputSignals { #[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 request_to_send(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requestToSend"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.request_to_send_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SerialPortFilter.rs b/crates/web-sys/src/features/gen_SerialPortFilter.rs index c323a35186e..e1f876619bf 100644 --- a/crates/web-sys/src/features/gen_SerialPortFilter.rs +++ b/crates/web-sys/src/features/gen_SerialPortFilter.rs @@ -14,6 +14,10 @@ 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 type SerialPortFilter; + #[wasm_bindgen(method, setter = "usbProductId")] + fn usb_product_id_shim(this: &SerialPortFilter, val: u16); + #[wasm_bindgen(method, setter = "usbVendorId")] + fn usb_vendor_id_shim(this: &SerialPortFilter, val: u16); } #[cfg(web_sys_unstable_apis)] impl SerialPortFilter { @@ -36,17 +40,7 @@ impl SerialPortFilter { #[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 usb_product_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbProductId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usb_product_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +51,7 @@ impl SerialPortFilter { #[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 usb_vendor_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbVendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usb_vendor_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SerialPortInfo.rs b/crates/web-sys/src/features/gen_SerialPortInfo.rs index 0ddd9ac77a6..90953d2923b 100644 --- a/crates/web-sys/src/features/gen_SerialPortInfo.rs +++ b/crates/web-sys/src/features/gen_SerialPortInfo.rs @@ -14,6 +14,10 @@ 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 type SerialPortInfo; + #[wasm_bindgen(method, setter = "usbProductId")] + fn usb_product_id_shim(this: &SerialPortInfo, val: u16); + #[wasm_bindgen(method, setter = "usbVendorId")] + fn usb_vendor_id_shim(this: &SerialPortInfo, val: u16); } #[cfg(web_sys_unstable_apis)] impl SerialPortInfo { @@ -36,17 +40,7 @@ impl SerialPortInfo { #[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 usb_product_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbProductId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usb_product_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +51,7 @@ impl SerialPortInfo { #[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 usb_vendor_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbVendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usb_vendor_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs b/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs index f87307fa5bf..34238c807e0 100644 --- a/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs +++ b/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs @@ -14,6 +14,8 @@ 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 type SerialPortRequestOptions; + #[wasm_bindgen(method, setter = "filters")] + fn filters_shim(this: &SerialPortRequestOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl SerialPortRequestOptions { @@ -36,17 +38,7 @@ impl SerialPortRequestOptions { #[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 filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filters_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ServerSocketOptions.rs b/crates/web-sys/src/features/gen_ServerSocketOptions.rs index 3db678f2efb..95133d8c0ef 100644 --- a/crates/web-sys/src/features/gen_ServerSocketOptions.rs +++ b/crates/web-sys/src/features/gen_ServerSocketOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`*"] pub type ServerSocketOptions; + #[cfg(feature = "TcpSocketBinaryType")] + #[wasm_bindgen(method, setter = "binaryType")] + fn binary_type_shim(this: &ServerSocketOptions, val: TcpSocketBinaryType); } impl ServerSocketOptions { #[doc = "Construct a new `ServerSocketOptions`."] @@ -25,17 +28,7 @@ impl ServerSocketOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`, `TcpSocketBinaryType`*"] pub fn binary_type(&mut self, val: TcpSocketBinaryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binaryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.binary_type_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ShadowRootInit.rs b/crates/web-sys/src/features/gen_ShadowRootInit.rs index 50a7111064a..e86cf54eebb 100644 --- a/crates/web-sys/src/features/gen_ShadowRootInit.rs +++ b/crates/web-sys/src/features/gen_ShadowRootInit.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`*"] pub type ShadowRootInit; + #[cfg(feature = "ShadowRootMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &ShadowRootInit, val: ShadowRootMode); } impl ShadowRootInit { #[cfg(feature = "ShadowRootMode")] @@ -27,13 +30,7 @@ impl ShadowRootInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"] pub fn mode(&mut self, val: ShadowRootMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ShareData.rs b/crates/web-sys/src/features/gen_ShareData.rs index cc44f17d96d..6ba4c5f8f6f 100644 --- a/crates/web-sys/src/features/gen_ShareData.rs +++ b/crates/web-sys/src/features/gen_ShareData.rs @@ -14,6 +14,14 @@ 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 type ShareData; + #[wasm_bindgen(method, setter = "files")] + fn files_shim(this: &ShareData, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "text")] + fn text_shim(this: &ShareData, val: &str); + #[wasm_bindgen(method, setter = "title")] + fn title_shim(this: &ShareData, val: &str); + #[wasm_bindgen(method, setter = "url")] + fn url_shim(this: &ShareData, val: &str); } #[cfg(web_sys_unstable_apis)] impl ShareData { @@ -36,13 +44,7 @@ impl ShareData { #[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 files(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("files"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.files_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,13 +55,7 @@ impl ShareData { #[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 text(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("text"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.text_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -70,13 +66,7 @@ impl ShareData { #[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 title(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("title"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.title_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -87,13 +77,7 @@ impl ShareData { #[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 url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.url_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SignResponse.rs b/crates/web-sys/src/features/gen_SignResponse.rs index 9d066b7423b..22a21bb2d05 100644 --- a/crates/web-sys/src/features/gen_SignResponse.rs +++ b/crates/web-sys/src/features/gen_SignResponse.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub type SignResponse; + #[wasm_bindgen(method, setter = "clientData")] + fn client_data_shim(this: &SignResponse, val: &str); + #[wasm_bindgen(method, setter = "errorCode")] + fn error_code_shim(this: &SignResponse, val: Option); + #[wasm_bindgen(method, setter = "errorMessage")] + fn error_message_shim(this: &SignResponse, val: Option<&str>); + #[wasm_bindgen(method, setter = "keyHandle")] + fn key_handle_shim(this: &SignResponse, val: &str); + #[wasm_bindgen(method, setter = "signatureData")] + fn signature_data_shim(this: &SignResponse, val: &str); } impl SignResponse { #[doc = "Construct a new `SignResponse`."] @@ -24,85 +34,35 @@ impl SignResponse { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub fn client_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_data_shim(val); self } #[doc = "Change the `errorCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub fn error_code(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_code_shim(val); self } #[doc = "Change the `errorMessage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub fn error_message(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorMessage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_message_shim(val); self } #[doc = "Change the `keyHandle` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub fn key_handle(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyHandle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_handle_shim(val); self } #[doc = "Change the `signatureData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub fn signature_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("signatureData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signature_data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SocketElement.rs b/crates/web-sys/src/features/gen_SocketElement.rs index 56269e3e4ab..cb535c7c6d2 100644 --- a/crates/web-sys/src/features/gen_SocketElement.rs +++ b/crates/web-sys/src/features/gen_SocketElement.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub type SocketElement; + #[wasm_bindgen(method, setter = "active")] + fn active_shim(this: &SocketElement, val: bool); + #[wasm_bindgen(method, setter = "host")] + fn host_shim(this: &SocketElement, val: &str); + #[wasm_bindgen(method, setter = "port")] + fn port_shim(this: &SocketElement, val: u32); + #[wasm_bindgen(method, setter = "received")] + fn received_shim(this: &SocketElement, val: f64); + #[wasm_bindgen(method, setter = "sent")] + fn sent_shim(this: &SocketElement, val: f64); + #[wasm_bindgen(method, setter = "tcp")] + fn tcp_shim(this: &SocketElement, val: bool); } impl SocketElement { #[doc = "Construct a new `SocketElement`."] @@ -24,83 +36,42 @@ impl SocketElement { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub fn active(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.active_shim(val); self } #[doc = "Change the `host` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub fn host(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("host"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.host_shim(val); self } #[doc = "Change the `port` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub fn port(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("port"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.port_shim(val); self } #[doc = "Change the `received` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub fn received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("received"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.received_shim(val); self } #[doc = "Change the `sent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub fn sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sent_shim(val); self } #[doc = "Change the `tcp` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub fn tcp(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tcp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.tcp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SocketOptions.rs b/crates/web-sys/src/features/gen_SocketOptions.rs index 6754c536101..18c27e4f0d5 100644 --- a/crates/web-sys/src/features/gen_SocketOptions.rs +++ b/crates/web-sys/src/features/gen_SocketOptions.rs @@ -10,6 +10,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketOptions`*"] pub type SocketOptions; + #[cfg(feature = "TcpSocketBinaryType")] + #[wasm_bindgen(method, setter = "binaryType")] + fn binary_type_shim(this: &SocketOptions, val: TcpSocketBinaryType); + #[wasm_bindgen(method, setter = "useSecureTransport")] + fn use_secure_transport_shim(this: &SocketOptions, val: bool); } impl SocketOptions { #[doc = "Construct a new `SocketOptions`."] @@ -25,34 +30,14 @@ impl SocketOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketOptions`, `TcpSocketBinaryType`*"] pub fn binary_type(&mut self, val: TcpSocketBinaryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binaryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.binary_type_shim(val); self } #[doc = "Change the `useSecureTransport` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketOptions`*"] pub fn use_secure_transport(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("useSecureTransport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.use_secure_transport_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SocketsDict.rs b/crates/web-sys/src/features/gen_SocketsDict.rs index f760fdf071e..8623ebb50a4 100644 --- a/crates/web-sys/src/features/gen_SocketsDict.rs +++ b/crates/web-sys/src/features/gen_SocketsDict.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] pub type SocketsDict; + #[wasm_bindgen(method, setter = "received")] + fn received_shim(this: &SocketsDict, val: f64); + #[wasm_bindgen(method, setter = "sent")] + fn sent_shim(this: &SocketsDict, val: f64); + #[wasm_bindgen(method, setter = "sockets")] + fn sockets_shim(this: &SocketsDict, val: &::wasm_bindgen::JsValue); } impl SocketsDict { #[doc = "Construct a new `SocketsDict`."] @@ -24,47 +30,21 @@ impl SocketsDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] pub fn received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("received"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.received_shim(val); self } #[doc = "Change the `sent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] pub fn sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sent_shim(val); self } #[doc = "Change the `sockets` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] pub fn sockets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sockets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sockets_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs b/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs index 96677fa0d02..6781c3939d3 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] pub type SpeechRecognitionErrorInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &SpeechRecognitionErrorInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &SpeechRecognitionErrorInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &SpeechRecognitionErrorInit, val: bool); + #[cfg(feature = "SpeechRecognitionErrorCode")] + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &SpeechRecognitionErrorInit, val: SpeechRecognitionErrorCode); + #[wasm_bindgen(method, setter = "message")] + fn message_shim(this: &SpeechRecognitionErrorInit, val: &str); } impl SpeechRecognitionErrorInit { #[doc = "Construct a new `SpeechRecognitionErrorInit`."] @@ -24,51 +35,21 @@ impl SpeechRecognitionErrorInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "SpeechRecognitionErrorCode")] @@ -76,30 +57,14 @@ impl SpeechRecognitionErrorInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorCode`, `SpeechRecognitionErrorInit`*"] pub fn error(&mut self, val: SpeechRecognitionErrorCode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[doc = "Change the `message` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs b/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs index 75e71fd7bc6..8db88b7b80f 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs @@ -10,6 +10,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub type SpeechRecognitionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &SpeechRecognitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &SpeechRecognitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &SpeechRecognitionEventInit, val: bool); + #[cfg(feature = "Document")] + #[wasm_bindgen(method, setter = "emma")] + fn emma_shim(this: &SpeechRecognitionEventInit, val: Option<&Document>); + #[wasm_bindgen(method, setter = "interpretation")] + fn interpretation_shim(this: &SpeechRecognitionEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "resultIndex")] + fn result_index_shim(this: &SpeechRecognitionEventInit, val: u32); + #[cfg(feature = "SpeechRecognitionResultList")] + #[wasm_bindgen(method, setter = "results")] + fn results_shim(this: &SpeechRecognitionEventInit, val: Option<&SpeechRecognitionResultList>); } impl SpeechRecognitionEventInit { #[doc = "Construct a new `SpeechRecognitionEventInit`."] @@ -24,51 +40,21 @@ impl SpeechRecognitionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "Document")] @@ -76,47 +62,21 @@ impl SpeechRecognitionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`, `SpeechRecognitionEventInit`*"] pub fn emma(&mut self, val: Option<&Document>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("emma"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.emma_shim(val); self } #[doc = "Change the `interpretation` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub fn interpretation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.interpretation_shim(val); self } #[doc = "Change the `resultIndex` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub fn result_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resultIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.result_index_shim(val); self } #[cfg(feature = "SpeechRecognitionResultList")] @@ -124,17 +84,7 @@ impl SpeechRecognitionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`, `SpeechRecognitionResultList`*"] pub fn results(&mut self, val: Option<&SpeechRecognitionResultList>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("results"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.results_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs b/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs index e53c1f0871a..54fe4337561 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs @@ -10,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub type SpeechSynthesisErrorEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &SpeechSynthesisErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &SpeechSynthesisErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &SpeechSynthesisErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "charIndex")] + fn char_index_shim(this: &SpeechSynthesisErrorEventInit, val: u32); + #[wasm_bindgen(method, setter = "charLength")] + fn char_length_shim(this: &SpeechSynthesisErrorEventInit, val: Option); + #[wasm_bindgen(method, setter = "elapsedTime")] + fn elapsed_time_shim(this: &SpeechSynthesisErrorEventInit, val: f32); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &SpeechSynthesisErrorEventInit, val: &str); + #[cfg(feature = "SpeechSynthesisUtterance")] + #[wasm_bindgen(method, setter = "utterance")] + fn utterance_shim(this: &SpeechSynthesisErrorEventInit, val: &SpeechSynthesisUtterance); + #[cfg(feature = "SpeechSynthesisErrorCode")] + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &SpeechSynthesisErrorEventInit, val: SpeechSynthesisErrorCode); } impl SpeechSynthesisErrorEventInit { #[cfg(all( @@ -30,115 +50,49 @@ impl SpeechSynthesisErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `charIndex` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn char_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.char_index_shim(val); self } #[doc = "Change the `charLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn char_length(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.char_length_shim(val); self } #[doc = "Change the `elapsedTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn elapsed_time(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("elapsedTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.elapsed_time_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(feature = "SpeechSynthesisUtterance")] @@ -146,17 +100,7 @@ impl SpeechSynthesisErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"] pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("utterance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.utterance_shim(val); self } #[cfg(feature = "SpeechSynthesisErrorCode")] @@ -164,13 +108,7 @@ impl SpeechSynthesisErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"] pub fn error(&mut self, val: SpeechSynthesisErrorCode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs b/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs index be45a338d84..3726366ad20 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs @@ -10,6 +10,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub type SpeechSynthesisEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &SpeechSynthesisEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &SpeechSynthesisEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &SpeechSynthesisEventInit, val: bool); + #[wasm_bindgen(method, setter = "charIndex")] + fn char_index_shim(this: &SpeechSynthesisEventInit, val: u32); + #[wasm_bindgen(method, setter = "charLength")] + fn char_length_shim(this: &SpeechSynthesisEventInit, val: Option); + #[wasm_bindgen(method, setter = "elapsedTime")] + fn elapsed_time_shim(this: &SpeechSynthesisEventInit, val: f32); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &SpeechSynthesisEventInit, val: &str); + #[cfg(feature = "SpeechSynthesisUtterance")] + #[wasm_bindgen(method, setter = "utterance")] + fn utterance_shim(this: &SpeechSynthesisEventInit, val: &SpeechSynthesisUtterance); } impl SpeechSynthesisEventInit { #[cfg(feature = "SpeechSynthesisUtterance")] @@ -26,115 +43,49 @@ impl SpeechSynthesisEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `charIndex` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn char_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.char_index_shim(val); self } #[doc = "Change the `charLength` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn char_length(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.char_length_shim(val); self } #[doc = "Change the `elapsedTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn elapsed_time(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("elapsedTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.elapsed_time_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(feature = "SpeechSynthesisUtterance")] @@ -142,17 +93,7 @@ impl SpeechSynthesisEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"] pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("utterance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.utterance_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StereoPannerOptions.rs b/crates/web-sys/src/features/gen_StereoPannerOptions.rs index 460ac46aa8d..792a024f70c 100644 --- a/crates/web-sys/src/features/gen_StereoPannerOptions.rs +++ b/crates/web-sys/src/features/gen_StereoPannerOptions.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] pub type StereoPannerOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &StereoPannerOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &StereoPannerOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &StereoPannerOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "pan")] + fn pan_shim(this: &StereoPannerOptions, val: f32); } impl StereoPannerOptions { #[doc = "Construct a new `StereoPannerOptions`."] @@ -24,17 +34,7 @@ impl StereoPannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +42,7 @@ impl StereoPannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `StereoPannerOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,30 +50,14 @@ impl StereoPannerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `StereoPannerOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `pan` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] pub fn pan(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pan"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pan_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StorageEstimate.rs b/crates/web-sys/src/features/gen_StorageEstimate.rs index e36eae6d6d7..242dc68778c 100644 --- a/crates/web-sys/src/features/gen_StorageEstimate.rs +++ b/crates/web-sys/src/features/gen_StorageEstimate.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] pub type StorageEstimate; + #[wasm_bindgen(method, setter = "quota")] + fn quota_shim(this: &StorageEstimate, val: f64); + #[wasm_bindgen(method, setter = "usage")] + fn usage_shim(this: &StorageEstimate, val: f64); } impl StorageEstimate { #[doc = "Construct a new `StorageEstimate`."] @@ -24,26 +28,14 @@ impl StorageEstimate { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] pub fn quota(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("quota"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.quota_shim(val); self } #[doc = "Change the `usage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] pub fn usage(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.usage_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StorageEventInit.rs b/crates/web-sys/src/features/gen_StorageEventInit.rs index 39544044472..5c42540d6d6 100644 --- a/crates/web-sys/src/features/gen_StorageEventInit.rs +++ b/crates/web-sys/src/features/gen_StorageEventInit.rs @@ -10,6 +10,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub type StorageEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &StorageEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &StorageEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &StorageEventInit, val: bool); + #[wasm_bindgen(method, setter = "key")] + fn key_shim(this: &StorageEventInit, val: Option<&str>); + #[wasm_bindgen(method, setter = "newValue")] + fn new_value_shim(this: &StorageEventInit, val: Option<&str>); + #[wasm_bindgen(method, setter = "oldValue")] + fn old_value_shim(this: &StorageEventInit, val: Option<&str>); + #[cfg(feature = "Storage")] + #[wasm_bindgen(method, setter = "storageArea")] + fn storage_area_shim(this: &StorageEventInit, val: Option<&Storage>); + #[wasm_bindgen(method, setter = "url")] + fn url_shim(this: &StorageEventInit, val: &str); } impl StorageEventInit { #[doc = "Construct a new `StorageEventInit`."] @@ -24,98 +41,42 @@ impl StorageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `key` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn key(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("key"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_shim(val); self } #[doc = "Change the `newValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn new_value(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("newValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.new_value_shim(val); self } #[doc = "Change the `oldValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn old_value(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("oldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.old_value_shim(val); self } #[cfg(feature = "Storage")] @@ -123,30 +84,14 @@ impl StorageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Storage`, `StorageEventInit`*"] pub fn storage_area(&mut self, val: Option<&Storage>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storageArea"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.storage_area_shim(val); self } #[doc = "Change the `url` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.url_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StreamPipeOptions.rs b/crates/web-sys/src/features/gen_StreamPipeOptions.rs index 924c0366f33..d9c02acc745 100644 --- a/crates/web-sys/src/features/gen_StreamPipeOptions.rs +++ b/crates/web-sys/src/features/gen_StreamPipeOptions.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] pub type StreamPipeOptions; + #[wasm_bindgen(method, setter = "preventAbort")] + fn prevent_abort_shim(this: &StreamPipeOptions, val: bool); + #[wasm_bindgen(method, setter = "preventCancel")] + fn prevent_cancel_shim(this: &StreamPipeOptions, val: bool); + #[wasm_bindgen(method, setter = "preventClose")] + fn prevent_close_shim(this: &StreamPipeOptions, val: bool); + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &StreamPipeOptions, val: &AbortSignal); } impl StreamPipeOptions { #[doc = "Construct a new `StreamPipeOptions`."] @@ -24,51 +33,21 @@ impl StreamPipeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] pub fn prevent_abort(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventAbort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prevent_abort_shim(val); self } #[doc = "Change the `preventCancel` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] pub fn prevent_cancel(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventCancel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prevent_cancel_shim(val); self } #[doc = "Change the `preventClose` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] pub fn prevent_close(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventClose"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.prevent_close_shim(val); self } #[cfg(feature = "AbortSignal")] @@ -76,14 +55,7 @@ impl StreamPipeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*"] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs b/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs index b2fe9406464..cf84e4807e9 100644 --- a/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] pub type StyleRuleChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &StyleRuleChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &StyleRuleChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &StyleRuleChangeEventInit, val: bool); + #[cfg(feature = "CssRule")] + #[wasm_bindgen(method, setter = "rule")] + fn rule_shim(this: &StyleRuleChangeEventInit, val: Option<&CssRule>); + #[cfg(feature = "CssStyleSheet")] + #[wasm_bindgen(method, setter = "stylesheet")] + fn stylesheet_shim(this: &StyleRuleChangeEventInit, val: Option<&CssStyleSheet>); } impl StyleRuleChangeEventInit { #[doc = "Construct a new `StyleRuleChangeEventInit`."] @@ -24,51 +36,21 @@ impl StyleRuleChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "CssRule")] @@ -76,13 +58,7 @@ impl StyleRuleChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssRule`, `StyleRuleChangeEventInit`*"] pub fn rule(&mut self, val: Option<&CssRule>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rule"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rule_shim(val); self } #[cfg(feature = "CssStyleSheet")] @@ -90,17 +66,7 @@ impl StyleRuleChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleRuleChangeEventInit`*"] pub fn stylesheet(&mut self, val: Option<&CssStyleSheet>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stylesheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stylesheet_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs b/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs index 42a98841ea3..547d1124cb7 100644 --- a/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] pub type StyleSheetApplicableStateChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "applicable")] + fn applicable_shim(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[cfg(feature = "CssStyleSheet")] + #[wasm_bindgen(method, setter = "stylesheet")] + fn stylesheet_shim( + this: &StyleSheetApplicableStateChangeEventInit, + val: Option<&CssStyleSheet>, + ); } impl StyleSheetApplicableStateChangeEventInit { #[doc = "Construct a new `StyleSheetApplicableStateChangeEventInit`."] @@ -24,68 +38,28 @@ impl StyleSheetApplicableStateChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `applicable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] pub fn applicable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("applicable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.applicable_shim(val); self } #[cfg(feature = "CssStyleSheet")] @@ -93,17 +67,7 @@ impl StyleSheetApplicableStateChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetApplicableStateChangeEventInit`*"] pub fn stylesheet(&mut self, val: Option<&CssStyleSheet>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stylesheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stylesheet_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs b/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs index 0a38714b51c..4aeb6e4fc4a 100644 --- a/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] pub type StyleSheetChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &StyleSheetChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &StyleSheetChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &StyleSheetChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "documentSheet")] + fn document_sheet_shim(this: &StyleSheetChangeEventInit, val: bool); + #[cfg(feature = "CssStyleSheet")] + #[wasm_bindgen(method, setter = "stylesheet")] + fn stylesheet_shim(this: &StyleSheetChangeEventInit, val: Option<&CssStyleSheet>); } impl StyleSheetChangeEventInit { #[doc = "Construct a new `StyleSheetChangeEventInit`."] @@ -24,68 +35,28 @@ impl StyleSheetChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `documentSheet` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] pub fn document_sheet(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("documentSheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.document_sheet_shim(val); self } #[cfg(feature = "CssStyleSheet")] @@ -93,17 +64,7 @@ impl StyleSheetChangeEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetChangeEventInit`*"] pub fn stylesheet(&mut self, val: Option<&CssStyleSheet>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stylesheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stylesheet_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SubmitEventInit.rs b/crates/web-sys/src/features/gen_SubmitEventInit.rs index ede5704d2a9..1fa2555e874 100644 --- a/crates/web-sys/src/features/gen_SubmitEventInit.rs +++ b/crates/web-sys/src/features/gen_SubmitEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] pub type SubmitEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &SubmitEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &SubmitEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &SubmitEventInit, val: bool); + #[cfg(feature = "HtmlElement")] + #[wasm_bindgen(method, setter = "submitter")] + fn submitter_shim(this: &SubmitEventInit, val: Option<&HtmlElement>); } impl SubmitEventInit { #[doc = "Construct a new `SubmitEventInit`."] @@ -24,51 +33,21 @@ impl SubmitEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "HtmlElement")] @@ -76,17 +55,7 @@ impl SubmitEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`, `SubmitEventInit`*"] pub fn submitter(&mut self, val: Option<&HtmlElement>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("submitter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.submitter_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SvcOutputMetadata.rs b/crates/web-sys/src/features/gen_SvcOutputMetadata.rs index 16e9251da19..f48c035565d 100644 --- a/crates/web-sys/src/features/gen_SvcOutputMetadata.rs +++ b/crates/web-sys/src/features/gen_SvcOutputMetadata.rs @@ -14,6 +14,8 @@ 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 type SvcOutputMetadata; + #[wasm_bindgen(method, setter = "temporalLayerId")] + fn temporal_layer_id_shim(this: &SvcOutputMetadata, val: u32); } #[cfg(web_sys_unstable_apis)] impl SvcOutputMetadata { @@ -36,17 +38,7 @@ impl SvcOutputMetadata { #[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 temporal_layer_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("temporalLayerId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.temporal_layer_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs b/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs index c141da7b2cd..4d83aa30982 100644 --- a/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs +++ b/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] pub type SvgBoundingBoxOptions; + #[wasm_bindgen(method, setter = "clipped")] + fn clipped_shim(this: &SvgBoundingBoxOptions, val: bool); + #[wasm_bindgen(method, setter = "fill")] + fn fill_shim(this: &SvgBoundingBoxOptions, val: bool); + #[wasm_bindgen(method, setter = "markers")] + fn markers_shim(this: &SvgBoundingBoxOptions, val: bool); + #[wasm_bindgen(method, setter = "stroke")] + fn stroke_shim(this: &SvgBoundingBoxOptions, val: bool); } impl SvgBoundingBoxOptions { #[doc = "Construct a new `SvgBoundingBoxOptions`."] @@ -24,61 +32,28 @@ impl SvgBoundingBoxOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] pub fn clipped(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clipped"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.clipped_shim(val); self } #[doc = "Change the `fill` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] pub fn fill(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fill_shim(val); self } #[doc = "Change the `markers` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] pub fn markers(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("markers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.markers_shim(val); self } #[doc = "Change the `stroke` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] pub fn stroke(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stroke"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stroke_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TaskControllerInit.rs b/crates/web-sys/src/features/gen_TaskControllerInit.rs index e66e8663d71..87fb5cbf035 100644 --- a/crates/web-sys/src/features/gen_TaskControllerInit.rs +++ b/crates/web-sys/src/features/gen_TaskControllerInit.rs @@ -14,6 +14,9 @@ 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 type TaskControllerInit; + #[cfg(feature = "TaskPriority")] + #[wasm_bindgen(method, setter = "priority")] + fn priority_shim(this: &TaskControllerInit, val: TaskPriority); } #[cfg(web_sys_unstable_apis)] impl TaskControllerInit { @@ -37,17 +40,7 @@ impl TaskControllerInit { #[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 priority(&mut self, val: TaskPriority) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.priority_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs b/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs index 9992965d1cc..c2fc50429fa 100644 --- a/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs @@ -14,6 +14,15 @@ 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 type TaskPriorityChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TaskPriorityChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TaskPriorityChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TaskPriorityChangeEventInit, val: bool); + #[cfg(feature = "TaskPriority")] + #[wasm_bindgen(method, setter = "previousPriority")] + fn previous_priority_shim(this: &TaskPriorityChangeEventInit, val: TaskPriority); } #[cfg(web_sys_unstable_apis)] impl TaskPriorityChangeEventInit { @@ -38,17 +47,7 @@ impl TaskPriorityChangeEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +58,7 @@ impl TaskPriorityChangeEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +69,7 @@ impl TaskPriorityChangeEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,17 +81,7 @@ impl TaskPriorityChangeEventInit { #[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 previous_priority(&mut self, val: TaskPriority) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("previousPriority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.previous_priority_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs b/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs index 3a81c9682d8..99b837c6d73 100644 --- a/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs +++ b/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs @@ -14,6 +14,8 @@ 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 type TaskSignalAnyInit; + #[wasm_bindgen(method, setter = "priority")] + fn priority_shim(this: &TaskSignalAnyInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl TaskSignalAnyInit { @@ -36,17 +38,7 @@ impl TaskSignalAnyInit { #[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 priority(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.priority_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs b/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs index ecea5b069b4..480782339ae 100644 --- a/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs +++ b/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] pub type TcpServerSocketEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TcpServerSocketEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TcpServerSocketEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TcpServerSocketEventInit, val: bool); + #[cfg(feature = "TcpSocket")] + #[wasm_bindgen(method, setter = "socket")] + fn socket_shim(this: &TcpServerSocketEventInit, val: Option<&TcpSocket>); } impl TcpServerSocketEventInit { #[doc = "Construct a new `TcpServerSocketEventInit`."] @@ -24,51 +33,21 @@ impl TcpServerSocketEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(feature = "TcpSocket")] @@ -76,14 +55,7 @@ impl TcpServerSocketEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`, `TcpSocket`*"] pub fn socket(&mut self, val: Option<&TcpSocket>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("socket"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.socket_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs b/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs index 2da5e7e06a7..8ce673d4787 100644 --- a/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub type TcpSocketErrorEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TcpSocketErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TcpSocketErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TcpSocketErrorEventInit, val: bool); + #[wasm_bindgen(method, setter = "message")] + fn message_shim(this: &TcpSocketErrorEventInit, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &TcpSocketErrorEventInit, val: &str); } impl TcpSocketErrorEventInit { #[doc = "Construct a new `TcpSocketErrorEventInit`."] @@ -24,81 +34,35 @@ impl TcpSocketErrorEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `message` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.message_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TcpSocketEventInit.rs b/crates/web-sys/src/features/gen_TcpSocketEventInit.rs index e98db7882e0..c73323b4dde 100644 --- a/crates/web-sys/src/features/gen_TcpSocketEventInit.rs +++ b/crates/web-sys/src/features/gen_TcpSocketEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] pub type TcpSocketEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TcpSocketEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TcpSocketEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TcpSocketEventInit, val: bool); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &TcpSocketEventInit, val: &::wasm_bindgen::JsValue); } impl TcpSocketEventInit { #[doc = "Construct a new `TcpSocketEventInit`."] @@ -24,64 +32,28 @@ impl TcpSocketEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TextDecodeOptions.rs b/crates/web-sys/src/features/gen_TextDecodeOptions.rs index 47a0df21387..ad37701b64f 100644 --- a/crates/web-sys/src/features/gen_TextDecodeOptions.rs +++ b/crates/web-sys/src/features/gen_TextDecodeOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`*"] pub type TextDecodeOptions; + #[wasm_bindgen(method, setter = "stream")] + fn stream_shim(this: &TextDecodeOptions, val: bool); } impl TextDecodeOptions { #[doc = "Construct a new `TextDecodeOptions`."] @@ -24,14 +26,7 @@ impl TextDecodeOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`*"] pub fn stream(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stream"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stream_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TextDecoderOptions.rs b/crates/web-sys/src/features/gen_TextDecoderOptions.rs index 1ec3b8f9478..ece2e78e5df 100644 --- a/crates/web-sys/src/features/gen_TextDecoderOptions.rs +++ b/crates/web-sys/src/features/gen_TextDecoderOptions.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecoderOptions`*"] pub type TextDecoderOptions; + #[wasm_bindgen(method, setter = "fatal")] + fn fatal_shim(this: &TextDecoderOptions, val: bool); } impl TextDecoderOptions { #[doc = "Construct a new `TextDecoderOptions`."] @@ -24,13 +26,7 @@ impl TextDecoderOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecoderOptions`*"] pub fn fatal(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fatal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fatal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TouchEventInit.rs b/crates/web-sys/src/features/gen_TouchEventInit.rs index 41523570b79..4cec29ce0b4 100644 --- a/crates/web-sys/src/features/gen_TouchEventInit.rs +++ b/crates/web-sys/src/features/gen_TouchEventInit.rs @@ -10,6 +10,49 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub type TouchEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &TouchEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &TouchEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &TouchEventInit, val: bool); + #[wasm_bindgen(method, setter = "changedTouches")] + fn changed_touches_shim(this: &TouchEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "targetTouches")] + fn target_touches_shim(this: &TouchEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "touches")] + fn touches_shim(this: &TouchEventInit, val: &::wasm_bindgen::JsValue); } impl TouchEventInit { #[doc = "Construct a new `TouchEventInit`."] @@ -24,65 +67,28 @@ impl TouchEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,282 +96,119 @@ impl TouchEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } #[doc = "Change the `changedTouches` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn changed_touches(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("changedTouches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.changed_touches_shim(val); self } #[doc = "Change the `targetTouches` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn target_touches(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targetTouches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.target_touches_shim(val); self } #[doc = "Change the `touches` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub fn touches(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("touches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.touches_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TouchInit.rs b/crates/web-sys/src/features/gen_TouchInit.rs index 1defc3fdda7..a9c5cc1745a 100644 --- a/crates/web-sys/src/features/gen_TouchInit.rs +++ b/crates/web-sys/src/features/gen_TouchInit.rs @@ -10,6 +10,31 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub type TouchInit; + #[wasm_bindgen(method, setter = "clientX")] + fn client_x_shim(this: &TouchInit, val: i32); + #[wasm_bindgen(method, setter = "clientY")] + fn client_y_shim(this: &TouchInit, val: i32); + #[wasm_bindgen(method, setter = "force")] + fn force_shim(this: &TouchInit, val: f32); + #[wasm_bindgen(method, setter = "identifier")] + fn identifier_shim(this: &TouchInit, val: i32); + #[wasm_bindgen(method, setter = "pageX")] + fn page_x_shim(this: &TouchInit, val: i32); + #[wasm_bindgen(method, setter = "pageY")] + fn page_y_shim(this: &TouchInit, val: i32); + #[wasm_bindgen(method, setter = "radiusX")] + fn radius_x_shim(this: &TouchInit, val: f32); + #[wasm_bindgen(method, setter = "radiusY")] + fn radius_y_shim(this: &TouchInit, val: f32); + #[wasm_bindgen(method, setter = "rotationAngle")] + fn rotation_angle_shim(this: &TouchInit, val: f32); + #[wasm_bindgen(method, setter = "screenX")] + fn screen_x_shim(this: &TouchInit, val: i32); + #[wasm_bindgen(method, setter = "screenY")] + fn screen_y_shim(this: &TouchInit, val: i32); + #[cfg(feature = "EventTarget")] + #[wasm_bindgen(method, setter = "target")] + fn target_shim(this: &TouchInit, val: &EventTarget); } impl TouchInit { #[cfg(feature = "EventTarget")] @@ -27,175 +52,77 @@ impl TouchInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_x_shim(val); self } #[doc = "Change the `clientY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_y_shim(val); self } #[doc = "Change the `force` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn force(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("force"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.force_shim(val); self } #[doc = "Change the `identifier` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn identifier(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("identifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.identifier_shim(val); self } #[doc = "Change the `pageX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn page_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pageX"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.page_x_shim(val); self } #[doc = "Change the `pageY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn page_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pageY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.page_y_shim(val); self } #[doc = "Change the `radiusX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn radius_x(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("radiusX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.radius_x_shim(val); self } #[doc = "Change the `radiusY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn radius_y(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("radiusY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.radius_y_shim(val); self } #[doc = "Change the `rotationAngle` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn rotation_angle(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rotationAngle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rotation_angle_shim(val); self } #[doc = "Change the `screenX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_x_shim(val); self } #[doc = "Change the `screenY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_y_shim(val); self } #[cfg(feature = "EventTarget")] @@ -203,14 +130,7 @@ impl TouchInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `TouchInit`*"] pub fn target(&mut self, val: &EventTarget) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("target"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.target_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TrackEventInit.rs b/crates/web-sys/src/features/gen_TrackEventInit.rs index 23ea70c99b9..18ede672b91 100644 --- a/crates/web-sys/src/features/gen_TrackEventInit.rs +++ b/crates/web-sys/src/features/gen_TrackEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] pub type TrackEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TrackEventInit, val: bool); + #[wasm_bindgen(method, setter = "track")] + fn track_shim(this: &TrackEventInit, val: Option<&::js_sys::Object>); } impl TrackEventInit { #[doc = "Construct a new `TrackEventInit`."] @@ -24,64 +32,28 @@ impl TrackEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `track` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] pub fn track(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.track_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_Transformer.rs b/crates/web-sys/src/features/gen_Transformer.rs index c53825cd3b4..02cb29200b1 100644 --- a/crates/web-sys/src/features/gen_Transformer.rs +++ b/crates/web-sys/src/features/gen_Transformer.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] pub type Transformer; + #[wasm_bindgen(method, setter = "flush")] + fn flush_shim(this: &Transformer, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "readableType")] + fn readable_type_shim(this: &Transformer, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "start")] + fn start_shim(this: &Transformer, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "transform")] + fn transform_shim(this: &Transformer, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "writableType")] + fn writable_type_shim(this: &Transformer, val: &::wasm_bindgen::JsValue); } impl Transformer { #[doc = "Construct a new `Transformer`."] @@ -24,77 +34,35 @@ impl Transformer { #[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.flush_shim(val); 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.readable_type_shim(val); 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.start_shim(val); 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.transform_shim(val); 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.writable_type_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TransitionEventInit.rs b/crates/web-sys/src/features/gen_TransitionEventInit.rs index fb65a019b1a..a6d000fd7b6 100644 --- a/crates/web-sys/src/features/gen_TransitionEventInit.rs +++ b/crates/web-sys/src/features/gen_TransitionEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub type TransitionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &TransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &TransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &TransitionEventInit, val: bool); + #[wasm_bindgen(method, setter = "elapsedTime")] + fn elapsed_time_shim(this: &TransitionEventInit, val: f32); + #[wasm_bindgen(method, setter = "propertyName")] + fn property_name_shim(this: &TransitionEventInit, val: &str); + #[wasm_bindgen(method, setter = "pseudoElement")] + fn pseudo_element_shim(this: &TransitionEventInit, val: &str); } impl TransitionEventInit { #[doc = "Construct a new `TransitionEventInit`."] @@ -24,102 +36,42 @@ impl TransitionEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `elapsedTime` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub fn elapsed_time(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("elapsedTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.elapsed_time_shim(val); self } #[doc = "Change the `propertyName` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub fn property_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("propertyName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.property_name_shim(val); self } #[doc = "Change the `pseudoElement` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub fn pseudo_element(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pseudoElement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.pseudo_element_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_TreeCellInfo.rs b/crates/web-sys/src/features/gen_TreeCellInfo.rs index a38c1d7f33a..6d46b866721 100644 --- a/crates/web-sys/src/features/gen_TreeCellInfo.rs +++ b/crates/web-sys/src/features/gen_TreeCellInfo.rs @@ -10,6 +10,10 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] pub type TreeCellInfo; + #[wasm_bindgen(method, setter = "childElt")] + fn child_elt_shim(this: &TreeCellInfo, val: &str); + #[wasm_bindgen(method, setter = "row")] + fn row_shim(this: &TreeCellInfo, val: i32); } impl TreeCellInfo { #[doc = "Construct a new `TreeCellInfo`."] @@ -24,30 +28,14 @@ impl TreeCellInfo { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] pub fn child_elt(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("childElt"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.child_elt_shim(val); self } #[doc = "Change the `row` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] pub fn row(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("row"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.row_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_U2fClientData.rs b/crates/web-sys/src/features/gen_U2fClientData.rs index f20f2f79b34..e633e97f4d6 100644 --- a/crates/web-sys/src/features/gen_U2fClientData.rs +++ b/crates/web-sys/src/features/gen_U2fClientData.rs @@ -10,6 +10,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] pub type U2fClientData; + #[wasm_bindgen(method, setter = "challenge")] + fn challenge_shim(this: &U2fClientData, val: &str); + #[wasm_bindgen(method, setter = "origin")] + fn origin_shim(this: &U2fClientData, val: &str); + #[wasm_bindgen(method, setter = "typ")] + fn typ_shim(this: &U2fClientData, val: &str); } impl U2fClientData { #[doc = "Construct a new `U2fClientData`."] @@ -24,44 +30,21 @@ impl U2fClientData { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] pub fn challenge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.challenge_shim(val); self } #[doc = "Change the `origin` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.origin_shim(val); self } #[doc = "Change the `typ` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] pub fn typ(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("typ"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.typ_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UdpMessageEventInit.rs b/crates/web-sys/src/features/gen_UdpMessageEventInit.rs index dcbe8702083..201113bd26f 100644 --- a/crates/web-sys/src/features/gen_UdpMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_UdpMessageEventInit.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub type UdpMessageEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &UdpMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &UdpMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &UdpMessageEventInit, val: bool); + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &UdpMessageEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "remoteAddress")] + fn remote_address_shim(this: &UdpMessageEventInit, val: &str); + #[wasm_bindgen(method, setter = "remotePort")] + fn remote_port_shim(this: &UdpMessageEventInit, val: u16); } impl UdpMessageEventInit { #[doc = "Construct a new `UdpMessageEventInit`."] @@ -24,98 +36,42 @@ impl UdpMessageEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val); self } #[doc = "Change the `remoteAddress` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub fn remote_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_address_shim(val); self } #[doc = "Change the `remotePort` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub fn remote_port(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remotePort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_port_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UdpOptions.rs b/crates/web-sys/src/features/gen_UdpOptions.rs index 74f4904f810..f890c614629 100644 --- a/crates/web-sys/src/features/gen_UdpOptions.rs +++ b/crates/web-sys/src/features/gen_UdpOptions.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub type UdpOptions; + #[wasm_bindgen(method, setter = "addressReuse")] + fn address_reuse_shim(this: &UdpOptions, val: bool); + #[wasm_bindgen(method, setter = "localAddress")] + fn local_address_shim(this: &UdpOptions, val: &str); + #[wasm_bindgen(method, setter = "localPort")] + fn local_port_shim(this: &UdpOptions, val: u16); + #[wasm_bindgen(method, setter = "loopback")] + fn loopback_shim(this: &UdpOptions, val: bool); + #[wasm_bindgen(method, setter = "remoteAddress")] + fn remote_address_shim(this: &UdpOptions, val: &str); + #[wasm_bindgen(method, setter = "remotePort")] + fn remote_port_shim(this: &UdpOptions, val: u16); } impl UdpOptions { #[doc = "Construct a new `UdpOptions`."] @@ -24,102 +36,42 @@ impl UdpOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub fn address_reuse(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressReuse"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.address_reuse_shim(val); self } #[doc = "Change the `localAddress` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub fn local_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.local_address_shim(val); self } #[doc = "Change the `localPort` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub fn local_port(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localPort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.local_port_shim(val); self } #[doc = "Change the `loopback` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub fn loopback(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("loopback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.loopback_shim(val); self } #[doc = "Change the `remoteAddress` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub fn remote_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_address_shim(val); self } #[doc = "Change the `remotePort` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub fn remote_port(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remotePort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.remote_port_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UiEventInit.rs b/crates/web-sys/src/features/gen_UiEventInit.rs index bb56110784a..de144f4ed4d 100644 --- a/crates/web-sys/src/features/gen_UiEventInit.rs +++ b/crates/web-sys/src/features/gen_UiEventInit.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] pub type UiEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &UiEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &UiEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &UiEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &UiEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &UiEventInit, val: Option<&Window>); } impl UiEventInit { #[doc = "Construct a new `UiEventInit`."] @@ -24,65 +35,28 @@ impl UiEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,13 +64,7 @@ impl UiEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UnderlyingSink.rs b/crates/web-sys/src/features/gen_UnderlyingSink.rs index 3c2f8a8a79f..458fc583361 100644 --- a/crates/web-sys/src/features/gen_UnderlyingSink.rs +++ b/crates/web-sys/src/features/gen_UnderlyingSink.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] pub type UnderlyingSink; + #[wasm_bindgen(method, setter = "abort")] + fn abort_shim(this: &UnderlyingSink, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "close")] + fn close_shim(this: &UnderlyingSink, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "start")] + fn start_shim(this: &UnderlyingSink, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &UnderlyingSink, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "write")] + fn write_shim(this: &UnderlyingSink, val: &::js_sys::Function); } impl UnderlyingSink { #[doc = "Construct a new `UnderlyingSink`."] @@ -24,65 +34,35 @@ impl UnderlyingSink { #[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.abort_shim(val); 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.close_shim(val); 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.start_shim(val); 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.type__shim(val); 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.write_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UnderlyingSource.rs b/crates/web-sys/src/features/gen_UnderlyingSource.rs index 1794bcc86e5..99efecb0e14 100644 --- a/crates/web-sys/src/features/gen_UnderlyingSource.rs +++ b/crates/web-sys/src/features/gen_UnderlyingSource.rs @@ -10,6 +10,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] pub type UnderlyingSource; + #[wasm_bindgen(method, setter = "autoAllocateChunkSize")] + fn auto_allocate_chunk_size_shim(this: &UnderlyingSource, val: f64); + #[wasm_bindgen(method, setter = "cancel")] + fn cancel_shim(this: &UnderlyingSource, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "pull")] + fn pull_shim(this: &UnderlyingSource, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "start")] + fn start_shim(this: &UnderlyingSource, val: &::js_sys::Function); + #[cfg(feature = "ReadableStreamType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &UnderlyingSource, val: ReadableStreamType); } impl UnderlyingSource { #[doc = "Construct a new `UnderlyingSource`."] @@ -24,57 +35,28 @@ impl UnderlyingSource { #[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.auto_allocate_chunk_size_shim(val); 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.cancel_shim(val); 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.pull_shim(val); 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.start_shim(val); self } #[cfg(feature = "ReadableStreamType")] @@ -82,13 +64,7 @@ impl UnderlyingSource { #[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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs b/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs index 745d869af4d..5bcbff99c6d 100644 --- a/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs +++ b/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs @@ -14,6 +14,15 @@ 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 type UsbConnectionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &UsbConnectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &UsbConnectionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &UsbConnectionEventInit, val: bool); + #[cfg(feature = "UsbDevice")] + #[wasm_bindgen(method, setter = "device")] + fn device_shim(this: &UsbConnectionEventInit, val: &UsbDevice); } #[cfg(web_sys_unstable_apis)] impl UsbConnectionEventInit { @@ -38,17 +47,7 @@ impl UsbConnectionEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +58,7 @@ impl UsbConnectionEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +69,7 @@ impl UsbConnectionEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,14 +81,7 @@ impl UsbConnectionEventInit { #[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 device(&mut self, val: &UsbDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.device_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs b/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs index a6a72f736a0..99a413d2354 100644 --- a/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs +++ b/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs @@ -14,6 +14,18 @@ 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 type UsbControlTransferParameters; + #[wasm_bindgen(method, setter = "index")] + fn index_shim(this: &UsbControlTransferParameters, val: u16); + #[cfg(feature = "UsbRecipient")] + #[wasm_bindgen(method, setter = "recipient")] + fn recipient_shim(this: &UsbControlTransferParameters, val: UsbRecipient); + #[wasm_bindgen(method, setter = "request")] + fn request_shim(this: &UsbControlTransferParameters, val: u8); + #[cfg(feature = "UsbRequestType")] + #[wasm_bindgen(method, setter = "requestType")] + fn request_type_shim(this: &UsbControlTransferParameters, val: UsbRequestType); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &UsbControlTransferParameters, val: u16); } #[cfg(web_sys_unstable_apis)] impl UsbControlTransferParameters { @@ -48,13 +60,7 @@ impl UsbControlTransferParameters { #[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 index(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("index"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.index_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -66,17 +72,7 @@ impl UsbControlTransferParameters { #[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 recipient(&mut self, val: UsbRecipient) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("recipient"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.recipient_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -87,17 +83,7 @@ impl UsbControlTransferParameters { #[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 request(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("request"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.request_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -109,17 +95,7 @@ impl UsbControlTransferParameters { #[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 request_type(&mut self, val: UsbRequestType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requestType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.request_type_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -130,13 +106,7 @@ impl UsbControlTransferParameters { #[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: u16) -> &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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbDeviceFilter.rs b/crates/web-sys/src/features/gen_UsbDeviceFilter.rs index 61fd2c90bca..1dcc503db30 100644 --- a/crates/web-sys/src/features/gen_UsbDeviceFilter.rs +++ b/crates/web-sys/src/features/gen_UsbDeviceFilter.rs @@ -14,6 +14,18 @@ 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 type UsbDeviceFilter; + #[wasm_bindgen(method, setter = "classCode")] + fn class_code_shim(this: &UsbDeviceFilter, val: u8); + #[wasm_bindgen(method, setter = "productId")] + fn product_id_shim(this: &UsbDeviceFilter, val: u16); + #[wasm_bindgen(method, setter = "protocolCode")] + fn protocol_code_shim(this: &UsbDeviceFilter, val: u8); + #[wasm_bindgen(method, setter = "serialNumber")] + fn serial_number_shim(this: &UsbDeviceFilter, val: &str); + #[wasm_bindgen(method, setter = "subclassCode")] + fn subclass_code_shim(this: &UsbDeviceFilter, val: u8); + #[wasm_bindgen(method, setter = "vendorId")] + fn vendor_id_shim(this: &UsbDeviceFilter, val: u16); } #[cfg(web_sys_unstable_apis)] impl UsbDeviceFilter { @@ -36,17 +48,7 @@ impl UsbDeviceFilter { #[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 class_code(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("classCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.class_code_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +59,7 @@ impl UsbDeviceFilter { #[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 product_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("productId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.product_id_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +70,7 @@ impl UsbDeviceFilter { #[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 protocol_code(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocolCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.protocol_code_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +81,7 @@ impl UsbDeviceFilter { #[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 serial_number(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serialNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.serial_number_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -120,17 +92,7 @@ impl UsbDeviceFilter { #[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 subclass_code(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subclassCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.subclass_code_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -141,17 +103,7 @@ impl UsbDeviceFilter { #[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 vendor_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.vendor_id_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs b/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs index a6c7b87cff8..7d05fe0b907 100644 --- a/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs +++ b/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs @@ -14,6 +14,8 @@ 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 type UsbDeviceRequestOptions; + #[wasm_bindgen(method, setter = "filters")] + fn filters_shim(this: &UsbDeviceRequestOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl UsbDeviceRequestOptions { @@ -37,17 +39,7 @@ impl UsbDeviceRequestOptions { #[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 filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filters_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs b/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs index 0def022717d..5688bc47d1f 100644 --- a/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs @@ -14,6 +14,11 @@ 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 type UsbPermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &UsbPermissionDescriptor, val: PermissionName); + #[wasm_bindgen(method, setter = "filters")] + fn filters_shim(this: &UsbPermissionDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl UsbPermissionDescriptor { @@ -39,13 +44,7 @@ impl UsbPermissionDescriptor { #[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 name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -56,17 +55,7 @@ impl UsbPermissionDescriptor { #[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 filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.filters_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbPermissionStorage.rs b/crates/web-sys/src/features/gen_UsbPermissionStorage.rs index 13bfc7d6d40..7fee5379ed9 100644 --- a/crates/web-sys/src/features/gen_UsbPermissionStorage.rs +++ b/crates/web-sys/src/features/gen_UsbPermissionStorage.rs @@ -14,6 +14,8 @@ 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 type UsbPermissionStorage; + #[wasm_bindgen(method, setter = "allowedDevices")] + fn allowed_devices_shim(this: &UsbPermissionStorage, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl UsbPermissionStorage { @@ -36,17 +38,7 @@ impl UsbPermissionStorage { #[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 allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowedDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.allowed_devices_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_UserProximityEventInit.rs b/crates/web-sys/src/features/gen_UserProximityEventInit.rs index 64e63f42986..7ab52a377c8 100644 --- a/crates/web-sys/src/features/gen_UserProximityEventInit.rs +++ b/crates/web-sys/src/features/gen_UserProximityEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] pub type UserProximityEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &UserProximityEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &UserProximityEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &UserProximityEventInit, val: bool); + #[wasm_bindgen(method, setter = "near")] + fn near_shim(this: &UserProximityEventInit, val: bool); } impl UserProximityEventInit { #[doc = "Construct a new `UserProximityEventInit`."] @@ -24,64 +32,28 @@ impl UserProximityEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `near` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] pub fn near(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("near"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.near_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_ValueEventInit.rs b/crates/web-sys/src/features/gen_ValueEventInit.rs index 5de054e0ded..0e095a187a1 100644 --- a/crates/web-sys/src/features/gen_ValueEventInit.rs +++ b/crates/web-sys/src/features/gen_ValueEventInit.rs @@ -14,6 +14,14 @@ 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 type ValueEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &ValueEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &ValueEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &ValueEventInit, val: bool); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &ValueEventInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl ValueEventInit { @@ -36,17 +44,7 @@ impl ValueEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +55,7 @@ impl ValueEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +66,7 @@ impl ValueEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,13 +77,7 @@ impl ValueEventInit { #[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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs b/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs index df749ddbd98..e2615680a89 100644 --- a/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs +++ b/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs @@ -14,6 +14,17 @@ 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 type VideoColorSpaceInit; + #[wasm_bindgen(method, setter = "fullRange")] + fn full_range_shim(this: &VideoColorSpaceInit, val: bool); + #[cfg(feature = "VideoMatrixCoefficients")] + #[wasm_bindgen(method, setter = "matrix")] + fn matrix_shim(this: &VideoColorSpaceInit, val: VideoMatrixCoefficients); + #[cfg(feature = "VideoColorPrimaries")] + #[wasm_bindgen(method, setter = "primaries")] + fn primaries_shim(this: &VideoColorSpaceInit, val: VideoColorPrimaries); + #[cfg(feature = "VideoTransferCharacteristics")] + #[wasm_bindgen(method, setter = "transfer")] + fn transfer_shim(this: &VideoColorSpaceInit, val: VideoTransferCharacteristics); } #[cfg(web_sys_unstable_apis)] impl VideoColorSpaceInit { @@ -36,17 +47,7 @@ impl VideoColorSpaceInit { #[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 full_range(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fullRange"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.full_range_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,14 +59,7 @@ impl VideoColorSpaceInit { #[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 matrix(&mut self, val: VideoMatrixCoefficients) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("matrix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.matrix_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -77,17 +71,7 @@ impl VideoColorSpaceInit { #[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 primaries(&mut self, val: VideoColorPrimaries) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("primaries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.primaries_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +83,7 @@ impl VideoColorSpaceInit { #[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 transfer(&mut self, val: VideoTransferCharacteristics) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transfer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.transfer_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoConfiguration.rs b/crates/web-sys/src/features/gen_VideoConfiguration.rs index 3b195f32897..e3ec5697201 100644 --- a/crates/web-sys/src/features/gen_VideoConfiguration.rs +++ b/crates/web-sys/src/features/gen_VideoConfiguration.rs @@ -10,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub type VideoConfiguration; + #[wasm_bindgen(method, setter = "bitrate")] + fn bitrate_shim(this: &VideoConfiguration, val: f64); + #[wasm_bindgen(method, setter = "contentType")] + fn content_type_shim(this: &VideoConfiguration, val: &str); + #[wasm_bindgen(method, setter = "framerate")] + fn framerate_shim(this: &VideoConfiguration, val: &str); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &VideoConfiguration, val: u32); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &VideoConfiguration, val: u32); } impl VideoConfiguration { #[doc = "Construct a new `VideoConfiguration`."] @@ -24,78 +34,35 @@ impl VideoConfiguration { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub fn bitrate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_shim(val); self } #[doc = "Change the `contentType` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub fn content_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contentType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.content_type_shim(val); self } #[doc = "Change the `framerate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub fn framerate(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_shim(val); self } #[doc = "Change the `height` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub fn height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[doc = "Change the `width` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub fn width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoDecoderConfig.rs b/crates/web-sys/src/features/gen_VideoDecoderConfig.rs index dad94139949..6dba5389dd5 100644 --- a/crates/web-sys/src/features/gen_VideoDecoderConfig.rs +++ b/crates/web-sys/src/features/gen_VideoDecoderConfig.rs @@ -14,6 +14,26 @@ 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 type VideoDecoderConfig; + #[wasm_bindgen(method, setter = "codec")] + fn codec_shim(this: &VideoDecoderConfig, val: &str); + #[wasm_bindgen(method, setter = "codedHeight")] + fn coded_height_shim(this: &VideoDecoderConfig, val: u32); + #[wasm_bindgen(method, setter = "codedWidth")] + fn coded_width_shim(this: &VideoDecoderConfig, val: u32); + #[cfg(feature = "VideoColorSpaceInit")] + #[wasm_bindgen(method, setter = "colorSpace")] + fn color_space_shim(this: &VideoDecoderConfig, val: &VideoColorSpaceInit); + #[wasm_bindgen(method, setter = "description")] + fn description_shim(this: &VideoDecoderConfig, val: &::js_sys::Object); + #[wasm_bindgen(method, setter = "displayAspectHeight")] + fn display_aspect_height_shim(this: &VideoDecoderConfig, val: u32); + #[wasm_bindgen(method, setter = "displayAspectWidth")] + fn display_aspect_width_shim(this: &VideoDecoderConfig, val: u32); + #[cfg(feature = "HardwareAcceleration")] + #[wasm_bindgen(method, setter = "hardwareAcceleration")] + fn hardware_acceleration_shim(this: &VideoDecoderConfig, val: HardwareAcceleration); + #[wasm_bindgen(method, setter = "optimizeForLatency")] + fn optimize_for_latency_shim(this: &VideoDecoderConfig, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoDecoderConfig { @@ -37,13 +57,7 @@ impl VideoDecoderConfig { #[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 codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +68,7 @@ impl VideoDecoderConfig { #[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 coded_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.coded_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +79,7 @@ impl VideoDecoderConfig { #[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 coded_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.coded_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -97,17 +91,7 @@ impl VideoDecoderConfig { #[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 color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_space_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -118,17 +102,7 @@ impl VideoDecoderConfig { #[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 description(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.description_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -139,17 +113,7 @@ impl VideoDecoderConfig { #[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 display_aspect_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayAspectHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_aspect_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -160,17 +124,7 @@ impl VideoDecoderConfig { #[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 display_aspect_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayAspectWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_aspect_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -182,17 +136,7 @@ impl VideoDecoderConfig { #[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 hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hardwareAcceleration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hardware_acceleration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -203,17 +147,7 @@ impl VideoDecoderConfig { #[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 optimize_for_latency(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optimizeForLatency"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.optimize_for_latency_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoDecoderInit.rs b/crates/web-sys/src/features/gen_VideoDecoderInit.rs index e0821b156d0..a4b15fb60ba 100644 --- a/crates/web-sys/src/features/gen_VideoDecoderInit.rs +++ b/crates/web-sys/src/features/gen_VideoDecoderInit.rs @@ -14,6 +14,10 @@ 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 type VideoDecoderInit; + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &VideoDecoderInit, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "output")] + fn output_shim(this: &VideoDecoderInit, val: &::js_sys::Function); } #[cfg(web_sys_unstable_apis)] impl VideoDecoderInit { @@ -38,13 +42,7 @@ impl VideoDecoderInit { #[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 error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,14 +53,7 @@ impl VideoDecoderInit { #[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 output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.output_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoDecoderSupport.rs b/crates/web-sys/src/features/gen_VideoDecoderSupport.rs index 6954b2feefb..25c91ef0900 100644 --- a/crates/web-sys/src/features/gen_VideoDecoderSupport.rs +++ b/crates/web-sys/src/features/gen_VideoDecoderSupport.rs @@ -14,6 +14,11 @@ 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 type VideoDecoderSupport; + #[cfg(feature = "VideoDecoderConfig")] + #[wasm_bindgen(method, setter = "config")] + fn config_shim(this: &VideoDecoderSupport, val: &VideoDecoderConfig); + #[wasm_bindgen(method, setter = "supported")] + fn supported_shim(this: &VideoDecoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoDecoderSupport { @@ -37,14 +42,7 @@ impl VideoDecoderSupport { #[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 config(&mut self, val: &VideoDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.config_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,17 +53,7 @@ impl VideoDecoderSupport { #[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 supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.supported_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderConfig.rs b/crates/web-sys/src/features/gen_VideoEncoderConfig.rs index e125dfed944..e546329b66e 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderConfig.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderConfig.rs @@ -14,6 +14,31 @@ 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 type VideoEncoderConfig; + #[cfg(feature = "AlphaOption")] + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &VideoEncoderConfig, val: AlphaOption); + #[wasm_bindgen(method, setter = "bitrate")] + fn bitrate_shim(this: &VideoEncoderConfig, val: f64); + #[wasm_bindgen(method, setter = "codec")] + fn codec_shim(this: &VideoEncoderConfig, val: &str); + #[wasm_bindgen(method, setter = "displayHeight")] + fn display_height_shim(this: &VideoEncoderConfig, val: u32); + #[wasm_bindgen(method, setter = "displayWidth")] + fn display_width_shim(this: &VideoEncoderConfig, val: u32); + #[wasm_bindgen(method, setter = "framerate")] + fn framerate_shim(this: &VideoEncoderConfig, val: f64); + #[cfg(feature = "HardwareAcceleration")] + #[wasm_bindgen(method, setter = "hardwareAcceleration")] + fn hardware_acceleration_shim(this: &VideoEncoderConfig, val: HardwareAcceleration); + #[wasm_bindgen(method, setter = "height")] + fn height_shim(this: &VideoEncoderConfig, val: u32); + #[cfg(feature = "LatencyMode")] + #[wasm_bindgen(method, setter = "latencyMode")] + fn latency_mode_shim(this: &VideoEncoderConfig, val: LatencyMode); + #[wasm_bindgen(method, setter = "scalabilityMode")] + fn scalability_mode_shim(this: &VideoEncoderConfig, val: &str); + #[wasm_bindgen(method, setter = "width")] + fn width_shim(this: &VideoEncoderConfig, val: u32); } #[cfg(web_sys_unstable_apis)] impl VideoEncoderConfig { @@ -40,13 +65,7 @@ impl VideoEncoderConfig { #[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 alpha(&mut self, val: AlphaOption) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +76,7 @@ impl VideoEncoderConfig { #[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 bitrate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bitrate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,13 +87,7 @@ impl VideoEncoderConfig { #[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 codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.codec_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,17 +98,7 @@ impl VideoEncoderConfig { #[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 display_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -116,17 +109,7 @@ impl VideoEncoderConfig { #[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 display_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -137,17 +120,7 @@ impl VideoEncoderConfig { #[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 framerate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framerate_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -159,17 +132,7 @@ impl VideoEncoderConfig { #[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 hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hardwareAcceleration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hardware_acceleration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -180,14 +143,7 @@ impl VideoEncoderConfig { #[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 height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -199,17 +155,7 @@ impl VideoEncoderConfig { #[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 latency_mode(&mut self, val: LatencyMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("latencyMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.latency_mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -220,17 +166,7 @@ impl VideoEncoderConfig { #[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 scalability_mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scalabilityMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.scalability_mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -241,13 +177,7 @@ impl VideoEncoderConfig { #[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 width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.width_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs b/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs index 76e81c9df34..f95a89936ee 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs @@ -14,6 +14,8 @@ 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 type VideoEncoderEncodeOptions; + #[wasm_bindgen(method, setter = "keyFrame")] + fn key_frame_shim(this: &VideoEncoderEncodeOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoEncoderEncodeOptions { @@ -36,17 +38,7 @@ impl VideoEncoderEncodeOptions { #[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 key_frame(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyFrame"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.key_frame_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderInit.rs b/crates/web-sys/src/features/gen_VideoEncoderInit.rs index 68c17f5590c..cbded7262e9 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderInit.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderInit.rs @@ -14,6 +14,10 @@ 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 type VideoEncoderInit; + #[wasm_bindgen(method, setter = "error")] + fn error_shim(this: &VideoEncoderInit, val: &::js_sys::Function); + #[wasm_bindgen(method, setter = "output")] + fn output_shim(this: &VideoEncoderInit, val: &::js_sys::Function); } #[cfg(web_sys_unstable_apis)] impl VideoEncoderInit { @@ -38,13 +42,7 @@ impl VideoEncoderInit { #[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 error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.error_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,14 +53,7 @@ impl VideoEncoderInit { #[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 output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.output_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderSupport.rs b/crates/web-sys/src/features/gen_VideoEncoderSupport.rs index 88a602b0a78..eb438851292 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderSupport.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderSupport.rs @@ -14,6 +14,11 @@ 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 type VideoEncoderSupport; + #[cfg(feature = "VideoEncoderConfig")] + #[wasm_bindgen(method, setter = "config")] + fn config_shim(this: &VideoEncoderSupport, val: &VideoEncoderConfig); + #[wasm_bindgen(method, setter = "supported")] + fn supported_shim(this: &VideoEncoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoEncoderSupport { @@ -37,14 +42,7 @@ impl VideoEncoderSupport { #[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 config(&mut self, val: &VideoEncoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.config_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,17 +53,7 @@ impl VideoEncoderSupport { #[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 supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.supported_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs b/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs index 339b4be9386..f86531d6092 100644 --- a/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs +++ b/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs @@ -14,6 +14,29 @@ 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 type VideoFrameBufferInit; + #[wasm_bindgen(method, setter = "codedHeight")] + fn coded_height_shim(this: &VideoFrameBufferInit, val: u32); + #[wasm_bindgen(method, setter = "codedWidth")] + fn coded_width_shim(this: &VideoFrameBufferInit, val: u32); + #[cfg(feature = "VideoColorSpaceInit")] + #[wasm_bindgen(method, setter = "colorSpace")] + fn color_space_shim(this: &VideoFrameBufferInit, val: &VideoColorSpaceInit); + #[wasm_bindgen(method, setter = "displayHeight")] + fn display_height_shim(this: &VideoFrameBufferInit, val: u32); + #[wasm_bindgen(method, setter = "displayWidth")] + fn display_width_shim(this: &VideoFrameBufferInit, val: u32); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &VideoFrameBufferInit, val: f64); + #[cfg(feature = "VideoPixelFormat")] + #[wasm_bindgen(method, setter = "format")] + fn format_shim(this: &VideoFrameBufferInit, val: VideoPixelFormat); + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &VideoFrameBufferInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &VideoFrameBufferInit, val: f64); + #[cfg(feature = "DomRectInit")] + #[wasm_bindgen(method, setter = "visibleRect")] + fn visible_rect_shim(this: &VideoFrameBufferInit, val: &DomRectInit); } #[cfg(web_sys_unstable_apis)] impl VideoFrameBufferInit { @@ -46,17 +69,7 @@ impl VideoFrameBufferInit { #[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 coded_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.coded_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -67,17 +80,7 @@ impl VideoFrameBufferInit { #[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 coded_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.coded_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -89,17 +92,7 @@ impl VideoFrameBufferInit { #[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 color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.color_space_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -110,17 +103,7 @@ impl VideoFrameBufferInit { #[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 display_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -131,17 +114,7 @@ impl VideoFrameBufferInit { #[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 display_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -152,17 +125,7 @@ impl VideoFrameBufferInit { #[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 duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -174,14 +137,7 @@ impl VideoFrameBufferInit { #[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 format(&mut self, val: VideoPixelFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.format_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -192,14 +148,7 @@ impl VideoFrameBufferInit { #[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 layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -210,17 +159,7 @@ impl VideoFrameBufferInit { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -232,17 +171,7 @@ impl VideoFrameBufferInit { #[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 visible_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibleRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.visible_rect_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs b/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs index 6278988f6a3..b4daba7283d 100644 --- a/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs +++ b/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs @@ -14,6 +14,11 @@ 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 type VideoFrameCopyToOptions; + #[wasm_bindgen(method, setter = "layout")] + fn layout_shim(this: &VideoFrameCopyToOptions, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "DomRectInit")] + #[wasm_bindgen(method, setter = "rect")] + fn rect_shim(this: &VideoFrameCopyToOptions, val: &DomRectInit); } #[cfg(web_sys_unstable_apis)] impl VideoFrameCopyToOptions { @@ -36,14 +41,7 @@ impl VideoFrameCopyToOptions { #[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 layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layout_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,13 +53,7 @@ impl VideoFrameCopyToOptions { #[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 rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rect_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoFrameInit.rs b/crates/web-sys/src/features/gen_VideoFrameInit.rs index 53224cb93ed..41ece8b8c55 100644 --- a/crates/web-sys/src/features/gen_VideoFrameInit.rs +++ b/crates/web-sys/src/features/gen_VideoFrameInit.rs @@ -14,6 +14,20 @@ 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 type VideoFrameInit; + #[cfg(feature = "AlphaOption")] + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &VideoFrameInit, val: AlphaOption); + #[wasm_bindgen(method, setter = "displayHeight")] + fn display_height_shim(this: &VideoFrameInit, val: u32); + #[wasm_bindgen(method, setter = "displayWidth")] + fn display_width_shim(this: &VideoFrameInit, val: u32); + #[wasm_bindgen(method, setter = "duration")] + fn duration_shim(this: &VideoFrameInit, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &VideoFrameInit, val: f64); + #[cfg(feature = "DomRectInit")] + #[wasm_bindgen(method, setter = "visibleRect")] + fn visible_rect_shim(this: &VideoFrameInit, val: &DomRectInit); } #[cfg(web_sys_unstable_apis)] impl VideoFrameInit { @@ -37,13 +51,7 @@ impl VideoFrameInit { #[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 alpha(&mut self, val: AlphaOption) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -54,17 +62,7 @@ impl VideoFrameInit { #[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 display_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_height_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -75,17 +73,7 @@ impl VideoFrameInit { #[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 display_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.display_width_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -96,17 +84,7 @@ impl VideoFrameInit { #[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 duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.duration_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -117,17 +95,7 @@ impl VideoFrameInit { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -139,17 +107,7 @@ impl VideoFrameInit { #[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 visible_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibleRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.visible_rect_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VoidCallback.rs b/crates/web-sys/src/features/gen_VoidCallback.rs index 16e8d5120ca..08d9643e49c 100644 --- a/crates/web-sys/src/features/gen_VoidCallback.rs +++ b/crates/web-sys/src/features/gen_VoidCallback.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VoidCallback`*"] pub type VoidCallback; + #[wasm_bindgen(method, setter = "handleEvent")] + fn handle_event_shim(this: &VoidCallback, val: &::js_sys::Function); } impl VoidCallback { #[doc = "Construct a new `VoidCallback`."] @@ -24,17 +26,7 @@ impl VoidCallback { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VoidCallback`*"] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.handle_event_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_VrLayer.rs b/crates/web-sys/src/features/gen_VrLayer.rs index 514ab0a6cf7..fef6d7169ab 100644 --- a/crates/web-sys/src/features/gen_VrLayer.rs +++ b/crates/web-sys/src/features/gen_VrLayer.rs @@ -10,6 +10,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] pub type VrLayer; + #[wasm_bindgen(method, setter = "leftBounds")] + fn left_bounds_shim(this: &VrLayer, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "rightBounds")] + fn right_bounds_shim(this: &VrLayer, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "HtmlCanvasElement")] + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &VrLayer, val: Option<&HtmlCanvasElement>); } impl VrLayer { #[doc = "Construct a new `VrLayer`."] @@ -24,34 +31,14 @@ impl VrLayer { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] pub fn left_bounds(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("leftBounds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.left_bounds_shim(val); self } #[doc = "Change the `rightBounds` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] pub fn right_bounds(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rightBounds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.right_bounds_shim(val); self } #[cfg(feature = "HtmlCanvasElement")] @@ -59,14 +46,7 @@ impl VrLayer { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `VrLayer`*"] pub fn source(&mut self, val: Option<&HtmlCanvasElement>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs index 741ed6b4f4d..910cb67592b 100644 --- a/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs +++ b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs @@ -14,6 +14,9 @@ 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 type WatchAdvertisementsOptions; + #[cfg(feature = "AbortSignal")] + #[wasm_bindgen(method, setter = "signal")] + fn signal_shim(this: &WatchAdvertisementsOptions, val: &AbortSignal); } #[cfg(web_sys_unstable_apis)] impl WatchAdvertisementsOptions { @@ -37,14 +40,7 @@ impl WatchAdvertisementsOptions { #[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 signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.signal_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WaveShaperOptions.rs b/crates/web-sys/src/features/gen_WaveShaperOptions.rs index 95f3a66e966..73eae9c0dc8 100644 --- a/crates/web-sys/src/features/gen_WaveShaperOptions.rs +++ b/crates/web-sys/src/features/gen_WaveShaperOptions.rs @@ -10,6 +10,19 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] pub type WaveShaperOptions; + #[wasm_bindgen(method, setter = "channelCount")] + fn channel_count_shim(this: &WaveShaperOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[wasm_bindgen(method, setter = "channelCountMode")] + fn channel_count_mode_shim(this: &WaveShaperOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[wasm_bindgen(method, setter = "channelInterpretation")] + fn channel_interpretation_shim(this: &WaveShaperOptions, val: ChannelInterpretation); + #[wasm_bindgen(method, setter = "curve")] + fn curve_shim(this: &WaveShaperOptions, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "OverSampleType")] + #[wasm_bindgen(method, setter = "oversample")] + fn oversample_shim(this: &WaveShaperOptions, val: OverSampleType); } impl WaveShaperOptions { #[doc = "Construct a new `WaveShaperOptions`."] @@ -24,17 +37,7 @@ impl WaveShaperOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] pub fn channel_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_shim(val); self } #[cfg(feature = "ChannelCountMode")] @@ -42,17 +45,7 @@ impl WaveShaperOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `WaveShaperOptions`*"] pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelCountMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_count_mode_shim(val); self } #[cfg(feature = "ChannelInterpretation")] @@ -60,30 +53,14 @@ impl WaveShaperOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `WaveShaperOptions`*"] pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channelInterpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.channel_interpretation_shim(val); self } #[doc = "Change the `curve` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] pub fn curve(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("curve"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.curve_shim(val); self } #[cfg(feature = "OverSampleType")] @@ -91,17 +68,7 @@ impl WaveShaperOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OverSampleType`, `WaveShaperOptions`*"] pub fn oversample(&mut self, val: OverSampleType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("oversample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.oversample_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebGlContextAttributes.rs b/crates/web-sys/src/features/gen_WebGlContextAttributes.rs index 71ce35e80ba..d939df42117 100644 --- a/crates/web-sys/src/features/gen_WebGlContextAttributes.rs +++ b/crates/web-sys/src/features/gen_WebGlContextAttributes.rs @@ -10,6 +10,25 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub type WebGlContextAttributes; + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &WebGlContextAttributes, val: bool); + #[wasm_bindgen(method, setter = "antialias")] + fn antialias_shim(this: &WebGlContextAttributes, val: bool); + #[wasm_bindgen(method, setter = "depth")] + fn depth_shim(this: &WebGlContextAttributes, val: bool); + #[wasm_bindgen(method, setter = "failIfMajorPerformanceCaveat")] + fn fail_if_major_performance_caveat_shim(this: &WebGlContextAttributes, val: bool); + #[cfg(feature = "WebGlPowerPreference")] + #[wasm_bindgen(method, setter = "powerPreference")] + fn power_preference_shim(this: &WebGlContextAttributes, val: WebGlPowerPreference); + #[wasm_bindgen(method, setter = "premultipliedAlpha")] + fn premultiplied_alpha_shim(this: &WebGlContextAttributes, val: bool); + #[wasm_bindgen(method, setter = "preserveDrawingBuffer")] + fn preserve_drawing_buffer_shim(this: &WebGlContextAttributes, val: bool); + #[wasm_bindgen(method, setter = "stencil")] + fn stencil_shim(this: &WebGlContextAttributes, val: bool); + #[wasm_bindgen(method, setter = "xrCompatible")] + fn xr_compatible_shim(this: &WebGlContextAttributes, val: bool); } impl WebGlContextAttributes { #[doc = "Construct a new `WebGlContextAttributes`."] @@ -24,60 +43,28 @@ impl WebGlContextAttributes { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[doc = "Change the `antialias` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn antialias(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("antialias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.antialias_shim(val); self } #[doc = "Change the `depth` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("depth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_shim(val); self } #[doc = "Change the `failIfMajorPerformanceCaveat` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn fail_if_major_performance_caveat(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("failIfMajorPerformanceCaveat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.fail_if_major_performance_caveat_shim(val); self } #[cfg(feature = "WebGlPowerPreference")] @@ -85,68 +72,28 @@ impl WebGlContextAttributes { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`, `WebGlPowerPreference`*"] pub fn power_preference(&mut self, val: WebGlPowerPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("powerPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.power_preference_shim(val); self } #[doc = "Change the `premultipliedAlpha` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultipliedAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.premultiplied_alpha_shim(val); self } #[doc = "Change the `preserveDrawingBuffer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn preserve_drawing_buffer(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preserveDrawingBuffer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.preserve_drawing_buffer_shim(val); self } #[doc = "Change the `stencil` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub fn stencil(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -157,17 +104,7 @@ impl WebGlContextAttributes { #[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 xr_compatible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("xrCompatible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.xr_compatible_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebGlContextEventInit.rs b/crates/web-sys/src/features/gen_WebGlContextEventInit.rs index 9be6bce33cf..870603872a7 100644 --- a/crates/web-sys/src/features/gen_WebGlContextEventInit.rs +++ b/crates/web-sys/src/features/gen_WebGlContextEventInit.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] pub type WebGlContextEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &WebGlContextEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &WebGlContextEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &WebGlContextEventInit, val: bool); + #[wasm_bindgen(method, setter = "statusMessage")] + fn status_message_shim(this: &WebGlContextEventInit, val: &str); } impl WebGlContextEventInit { #[doc = "Construct a new `WebGlContextEventInit`."] @@ -24,68 +32,28 @@ impl WebGlContextEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `statusMessage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] pub fn status_message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("statusMessage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.status_message_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebSocketDict.rs b/crates/web-sys/src/features/gen_WebSocketDict.rs index c9a67c34c4c..1586581b065 100644 --- a/crates/web-sys/src/features/gen_WebSocketDict.rs +++ b/crates/web-sys/src/features/gen_WebSocketDict.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketDict`*"] pub type WebSocketDict; + #[wasm_bindgen(method, setter = "websockets")] + fn websockets_shim(this: &WebSocketDict, val: &::wasm_bindgen::JsValue); } impl WebSocketDict { #[doc = "Construct a new `WebSocketDict`."] @@ -24,17 +26,7 @@ impl WebSocketDict { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketDict`*"] pub fn websockets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("websockets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.websockets_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebSocketElement.rs b/crates/web-sys/src/features/gen_WebSocketElement.rs index 99746cd6e70..ebe600ee7b1 100644 --- a/crates/web-sys/src/features/gen_WebSocketElement.rs +++ b/crates/web-sys/src/features/gen_WebSocketElement.rs @@ -10,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub type WebSocketElement; + #[wasm_bindgen(method, setter = "encrypted")] + fn encrypted_shim(this: &WebSocketElement, val: bool); + #[wasm_bindgen(method, setter = "hostport")] + fn hostport_shim(this: &WebSocketElement, val: &str); + #[wasm_bindgen(method, setter = "msgreceived")] + fn msgreceived_shim(this: &WebSocketElement, val: u32); + #[wasm_bindgen(method, setter = "msgsent")] + fn msgsent_shim(this: &WebSocketElement, val: u32); + #[wasm_bindgen(method, setter = "receivedsize")] + fn receivedsize_shim(this: &WebSocketElement, val: f64); + #[wasm_bindgen(method, setter = "sentsize")] + fn sentsize_shim(this: &WebSocketElement, val: f64); } impl WebSocketElement { #[doc = "Construct a new `WebSocketElement`."] @@ -24,102 +36,42 @@ impl WebSocketElement { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub fn encrypted(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encrypted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.encrypted_shim(val); self } #[doc = "Change the `hostport` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub fn hostport(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hostport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.hostport_shim(val); self } #[doc = "Change the `msgreceived` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub fn msgreceived(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("msgreceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.msgreceived_shim(val); self } #[doc = "Change the `msgsent` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub fn msgsent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("msgsent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.msgsent_shim(val); self } #[doc = "Change the `receivedsize` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub fn receivedsize(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("receivedsize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.receivedsize_shim(val); self } #[doc = "Change the `sentsize` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub fn sentsize(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sentsize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.sentsize_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs b/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs index 1ecd401b83d..28ef40240d5 100644 --- a/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs +++ b/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs @@ -14,6 +14,10 @@ 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 type WebTransportCloseInfo; + #[wasm_bindgen(method, setter = "closeCode")] + fn close_code_shim(this: &WebTransportCloseInfo, val: u32); + #[wasm_bindgen(method, setter = "reason")] + fn reason_shim(this: &WebTransportCloseInfo, val: &str); } #[cfg(web_sys_unstable_apis)] impl WebTransportCloseInfo { @@ -36,17 +40,7 @@ impl WebTransportCloseInfo { #[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_code(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("closeCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.close_code_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,14 +51,7 @@ impl WebTransportCloseInfo { #[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 reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reason_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs b/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs index 8817e6b206e..70def34726b 100644 --- a/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs +++ b/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs @@ -14,6 +14,14 @@ 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 type WebTransportDatagramStats; + #[wasm_bindgen(method, setter = "droppedIncoming")] + fn dropped_incoming_shim(this: &WebTransportDatagramStats, val: f64); + #[wasm_bindgen(method, setter = "expiredOutgoing")] + fn expired_outgoing_shim(this: &WebTransportDatagramStats, val: f64); + #[wasm_bindgen(method, setter = "lostOutgoing")] + fn lost_outgoing_shim(this: &WebTransportDatagramStats, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &WebTransportDatagramStats, val: f64); } #[cfg(web_sys_unstable_apis)] impl WebTransportDatagramStats { @@ -36,17 +44,7 @@ impl WebTransportDatagramStats { #[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 dropped_incoming(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("droppedIncoming"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.dropped_incoming_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +55,7 @@ impl WebTransportDatagramStats { #[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 expired_outgoing(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expiredOutgoing"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.expired_outgoing_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +66,7 @@ impl WebTransportDatagramStats { #[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 lost_outgoing(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lostOutgoing"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lost_outgoing_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +77,7 @@ impl WebTransportDatagramStats { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs b/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs index e643b6207fa..05069e0a71c 100644 --- a/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs +++ b/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs @@ -14,6 +14,11 @@ 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 type WebTransportErrorOptions; + #[cfg(feature = "WebTransportErrorSource")] + #[wasm_bindgen(method, setter = "source")] + fn source_shim(this: &WebTransportErrorOptions, val: WebTransportErrorSource); + #[wasm_bindgen(method, setter = "streamErrorCode")] + fn stream_error_code_shim(this: &WebTransportErrorOptions, val: Option); } #[cfg(web_sys_unstable_apis)] impl WebTransportErrorOptions { @@ -37,14 +42,7 @@ impl WebTransportErrorOptions { #[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 source(&mut self, val: WebTransportErrorSource) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.source_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -55,17 +53,7 @@ impl WebTransportErrorOptions { #[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 stream_error_code(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streamErrorCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stream_error_code_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportHash.rs b/crates/web-sys/src/features/gen_WebTransportHash.rs index 1ec62f4a843..46c4052620a 100644 --- a/crates/web-sys/src/features/gen_WebTransportHash.rs +++ b/crates/web-sys/src/features/gen_WebTransportHash.rs @@ -14,6 +14,10 @@ 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 type WebTransportHash; + #[wasm_bindgen(method, setter = "algorithm")] + fn algorithm_shim(this: &WebTransportHash, val: &str); + #[wasm_bindgen(method, setter = "value")] + fn value_shim(this: &WebTransportHash, val: &::js_sys::Object); } #[cfg(web_sys_unstable_apis)] impl WebTransportHash { @@ -36,17 +40,7 @@ impl WebTransportHash { #[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 algorithm(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("algorithm"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.algorithm_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +51,7 @@ impl WebTransportHash { #[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.value_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportOptions.rs b/crates/web-sys/src/features/gen_WebTransportOptions.rs index 178e32110aa..bd20cadbb79 100644 --- a/crates/web-sys/src/features/gen_WebTransportOptions.rs +++ b/crates/web-sys/src/features/gen_WebTransportOptions.rs @@ -14,6 +14,15 @@ 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 type WebTransportOptions; + #[wasm_bindgen(method, setter = "allowPooling")] + fn allow_pooling_shim(this: &WebTransportOptions, val: bool); + #[cfg(feature = "WebTransportCongestionControl")] + #[wasm_bindgen(method, setter = "congestionControl")] + fn congestion_control_shim(this: &WebTransportOptions, val: WebTransportCongestionControl); + #[wasm_bindgen(method, setter = "requireUnreliable")] + fn require_unreliable_shim(this: &WebTransportOptions, val: bool); + #[wasm_bindgen(method, setter = "serverCertificateHashes")] + fn server_certificate_hashes_shim(this: &WebTransportOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl WebTransportOptions { @@ -36,17 +45,7 @@ impl WebTransportOptions { #[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 allow_pooling(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowPooling"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.allow_pooling_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +57,7 @@ impl WebTransportOptions { #[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 congestion_control(&mut self, val: WebTransportCongestionControl) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("congestionControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.congestion_control_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +68,7 @@ impl WebTransportOptions { #[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 require_unreliable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requireUnreliable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.require_unreliable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,17 +79,7 @@ impl WebTransportOptions { #[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 server_certificate_hashes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serverCertificateHashes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.server_certificate_hashes_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs b/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs index 635908f98d8..61a4c3d60c6 100644 --- a/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs +++ b/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs @@ -14,6 +14,12 @@ 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 type WebTransportReceiveStreamStats; + #[wasm_bindgen(method, setter = "bytesRead")] + fn bytes_read_shim(this: &WebTransportReceiveStreamStats, val: f64); + #[wasm_bindgen(method, setter = "bytesReceived")] + fn bytes_received_shim(this: &WebTransportReceiveStreamStats, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &WebTransportReceiveStreamStats, val: f64); } #[cfg(web_sys_unstable_apis)] impl WebTransportReceiveStreamStats { @@ -36,17 +42,7 @@ impl WebTransportReceiveStreamStats { #[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 bytes_read(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesRead"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_read_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +53,7 @@ impl WebTransportReceiveStreamStats { #[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 bytes_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_received_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +64,7 @@ impl WebTransportReceiveStreamStats { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs b/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs index 61d694c8e49..d4b1ee2cd93 100644 --- a/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs +++ b/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs @@ -14,6 +14,8 @@ 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 type WebTransportSendStreamOptions; + #[wasm_bindgen(method, setter = "sendOrder")] + fn send_order_shim(this: &WebTransportSendStreamOptions, val: Option); } #[cfg(web_sys_unstable_apis)] impl WebTransportSendStreamOptions { @@ -36,17 +38,7 @@ impl WebTransportSendStreamOptions { #[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 send_order(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sendOrder"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.send_order_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs b/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs index 524a1bcfc46..373f9a7bc13 100644 --- a/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs +++ b/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs @@ -14,6 +14,14 @@ 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 type WebTransportSendStreamStats; + #[wasm_bindgen(method, setter = "bytesAcknowledged")] + fn bytes_acknowledged_shim(this: &WebTransportSendStreamStats, val: f64); + #[wasm_bindgen(method, setter = "bytesSent")] + fn bytes_sent_shim(this: &WebTransportSendStreamStats, val: f64); + #[wasm_bindgen(method, setter = "bytesWritten")] + fn bytes_written_shim(this: &WebTransportSendStreamStats, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &WebTransportSendStreamStats, val: f64); } #[cfg(web_sys_unstable_apis)] impl WebTransportSendStreamStats { @@ -36,17 +44,7 @@ impl WebTransportSendStreamStats { #[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 bytes_acknowledged(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesAcknowledged"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_acknowledged_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +55,7 @@ impl WebTransportSendStreamStats { #[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 bytes_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_sent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -78,17 +66,7 @@ impl WebTransportSendStreamStats { #[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 bytes_written(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesWritten"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_written_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -99,17 +77,7 @@ impl WebTransportSendStreamStats { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransportStats.rs b/crates/web-sys/src/features/gen_WebTransportStats.rs index d28d35440f7..bc2b8fd4347 100644 --- a/crates/web-sys/src/features/gen_WebTransportStats.rs +++ b/crates/web-sys/src/features/gen_WebTransportStats.rs @@ -14,6 +14,31 @@ 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 type WebTransportStats; + #[wasm_bindgen(method, setter = "bytesReceived")] + fn bytes_received_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "bytesSent")] + fn bytes_sent_shim(this: &WebTransportStats, val: f64); + #[cfg(feature = "WebTransportDatagramStats")] + #[wasm_bindgen(method, setter = "datagrams")] + fn datagrams_shim(this: &WebTransportStats, val: &WebTransportDatagramStats); + #[wasm_bindgen(method, setter = "minRtt")] + fn min_rtt_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "numIncomingStreamsCreated")] + fn num_incoming_streams_created_shim(this: &WebTransportStats, val: u32); + #[wasm_bindgen(method, setter = "numOutgoingStreamsCreated")] + fn num_outgoing_streams_created_shim(this: &WebTransportStats, val: u32); + #[wasm_bindgen(method, setter = "packetsLost")] + fn packets_lost_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "packetsReceived")] + fn packets_received_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "packetsSent")] + fn packets_sent_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "rttVariation")] + fn rtt_variation_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "smoothedRtt")] + fn smoothed_rtt_shim(this: &WebTransportStats, val: f64); + #[wasm_bindgen(method, setter = "timestamp")] + fn timestamp_shim(this: &WebTransportStats, val: f64); } #[cfg(web_sys_unstable_apis)] impl WebTransportStats { @@ -36,17 +61,7 @@ impl WebTransportStats { #[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 bytes_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_received_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +72,7 @@ impl WebTransportStats { #[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 bytes_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bytes_sent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +84,7 @@ impl WebTransportStats { #[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 datagrams(&mut self, val: &WebTransportDatagramStats) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("datagrams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.datagrams_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,14 +95,7 @@ impl WebTransportStats { #[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 min_rtt(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("minRtt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.min_rtt_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -118,17 +106,7 @@ impl WebTransportStats { #[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 num_incoming_streams_created(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numIncomingStreamsCreated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.num_incoming_streams_created_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -139,17 +117,7 @@ impl WebTransportStats { #[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 num_outgoing_streams_created(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numOutgoingStreamsCreated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.num_outgoing_streams_created_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -160,17 +128,7 @@ impl WebTransportStats { #[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 packets_lost(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsLost"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.packets_lost_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -181,17 +139,7 @@ impl WebTransportStats { #[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 packets_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.packets_received_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -202,17 +150,7 @@ impl WebTransportStats { #[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 packets_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.packets_sent_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -223,17 +161,7 @@ impl WebTransportStats { #[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 rtt_variation(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rttVariation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.rtt_variation_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -244,17 +172,7 @@ impl WebTransportStats { #[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 smoothed_rtt(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("smoothedRtt"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.smoothed_rtt_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -265,17 +183,7 @@ impl WebTransportStats { #[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 timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.timestamp_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WheelEventInit.rs b/crates/web-sys/src/features/gen_WheelEventInit.rs index c29db30d089..26a815349b6 100644 --- a/crates/web-sys/src/features/gen_WheelEventInit.rs +++ b/crates/web-sys/src/features/gen_WheelEventInit.rs @@ -10,6 +10,70 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub type WheelEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "detail")] + fn detail_shim(this: &WheelEventInit, val: i32); + #[cfg(feature = "Window")] + #[wasm_bindgen(method, setter = "view")] + fn view_shim(this: &WheelEventInit, val: Option<&Window>); + #[wasm_bindgen(method, setter = "altKey")] + fn alt_key_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "ctrlKey")] + fn ctrl_key_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "metaKey")] + fn meta_key_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierAltGraph")] + fn modifier_alt_graph_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierCapsLock")] + fn modifier_caps_lock_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFn")] + fn modifier_fn_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierFnLock")] + fn modifier_fn_lock_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierNumLock")] + fn modifier_num_lock_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierOS")] + fn modifier_os_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierScrollLock")] + fn modifier_scroll_lock_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbol")] + fn modifier_symbol_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + fn modifier_symbol_lock_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "shiftKey")] + fn shift_key_shim(this: &WheelEventInit, val: bool); + #[wasm_bindgen(method, setter = "button")] + fn button_shim(this: &WheelEventInit, val: i16); + #[wasm_bindgen(method, setter = "buttons")] + fn buttons_shim(this: &WheelEventInit, val: u16); + #[wasm_bindgen(method, setter = "clientX")] + fn client_x_shim(this: &WheelEventInit, val: i32); + #[wasm_bindgen(method, setter = "clientY")] + fn client_y_shim(this: &WheelEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementX")] + fn movement_x_shim(this: &WheelEventInit, val: i32); + #[wasm_bindgen(method, setter = "movementY")] + fn movement_y_shim(this: &WheelEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[wasm_bindgen(method, setter = "relatedTarget")] + fn related_target_shim(this: &WheelEventInit, val: Option<&EventTarget>); + #[wasm_bindgen(method, setter = "screenX")] + fn screen_x_shim(this: &WheelEventInit, val: i32); + #[wasm_bindgen(method, setter = "screenY")] + fn screen_y_shim(this: &WheelEventInit, val: i32); + #[wasm_bindgen(method, setter = "deltaMode")] + fn delta_mode_shim(this: &WheelEventInit, val: u32); + #[wasm_bindgen(method, setter = "deltaX")] + fn delta_x_shim(this: &WheelEventInit, val: f64); + #[wasm_bindgen(method, setter = "deltaY")] + fn delta_y_shim(this: &WheelEventInit, val: f64); + #[wasm_bindgen(method, setter = "deltaZ")] + fn delta_z_shim(this: &WheelEventInit, val: f64); } impl WheelEventInit { #[doc = "Construct a new `WheelEventInit`."] @@ -24,65 +88,28 @@ impl WheelEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[doc = "Change the `cancelable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[doc = "Change the `composed` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[doc = "Change the `detail` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.detail_shim(val); self } #[cfg(feature = "Window")] @@ -90,330 +117,140 @@ impl WheelEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`, `Window`*"] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.view_shim(val); self } #[doc = "Change the `altKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alt_key_shim(val); self } #[doc = "Change the `ctrlKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ctrl_key_shim(val); self } #[doc = "Change the `metaKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.meta_key_shim(val); self } #[doc = "Change the `modifierAltGraph` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_alt_graph_shim(val); self } #[doc = "Change the `modifierCapsLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_caps_lock_shim(val); self } #[doc = "Change the `modifierFn` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_shim(val); self } #[doc = "Change the `modifierFnLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_fn_lock_shim(val); self } #[doc = "Change the `modifierNumLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_num_lock_shim(val); self } #[doc = "Change the `modifierOS` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_os_shim(val); self } #[doc = "Change the `modifierScrollLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_scroll_lock_shim(val); self } #[doc = "Change the `modifierSymbol` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_shim(val); self } #[doc = "Change the `modifierSymbolLock` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.modifier_symbol_lock_shim(val); self } #[doc = "Change the `shiftKey` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.shift_key_shim(val); self } #[doc = "Change the `button` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.button_shim(val); self } #[doc = "Change the `buttons` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.buttons_shim(val); self } #[doc = "Change the `clientX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_x_shim(val); self } #[doc = "Change the `clientY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.client_y_shim(val); self } #[doc = "Change the `movementX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_x_shim(val); self } #[doc = "Change the `movementY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.movement_y_shim(val); self } #[cfg(feature = "EventTarget")] @@ -421,110 +258,49 @@ impl WheelEventInit { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `WheelEventInit`*"] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.related_target_shim(val); self } #[doc = "Change the `screenX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_x_shim(val); self } #[doc = "Change the `screenY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.screen_y_shim(val); self } #[doc = "Change the `deltaMode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn delta_mode(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deltaMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delta_mode_shim(val); self } #[doc = "Change the `deltaX` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn delta_x(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaX"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delta_x_shim(val); self } #[doc = "Change the `deltaY` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn delta_y(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delta_y_shim(val); self } #[doc = "Change the `deltaZ` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub fn delta_z(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaZ"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.delta_z_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WidevineCdmManifest.rs b/crates/web-sys/src/features/gen_WidevineCdmManifest.rs index 3d8ba3f4bf2..18a7300b0a1 100644 --- a/crates/web-sys/src/features/gen_WidevineCdmManifest.rs +++ b/crates/web-sys/src/features/gen_WidevineCdmManifest.rs @@ -10,6 +10,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub type WidevineCdmManifest; + #[wasm_bindgen(method, setter = "description")] + fn description_shim(this: &WidevineCdmManifest, val: &str); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &WidevineCdmManifest, val: &str); + #[wasm_bindgen(method, setter = "version")] + fn version_shim(this: &WidevineCdmManifest, val: &str); + #[wasm_bindgen(method, setter = "x-cdm-codecs")] + fn x_cdm_codecs_shim(this: &WidevineCdmManifest, val: &str); + #[wasm_bindgen(method, setter = "x-cdm-host-versions")] + fn x_cdm_host_versions_shim(this: &WidevineCdmManifest, val: &str); + #[wasm_bindgen(method, setter = "x-cdm-interface-versions")] + fn x_cdm_interface_versions_shim(this: &WidevineCdmManifest, val: &str); + #[wasm_bindgen(method, setter = "x-cdm-module-versions")] + fn x_cdm_module_versions_shim(this: &WidevineCdmManifest, val: &str); } impl WidevineCdmManifest { #[doc = "Construct a new `WidevineCdmManifest`."] @@ -39,115 +53,49 @@ impl WidevineCdmManifest { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.description_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[doc = "Change the `version` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.version_shim(val); self } #[doc = "Change the `x-cdm-codecs` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn x_cdm_codecs(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-codecs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_cdm_codecs_shim(val); self } #[doc = "Change the `x-cdm-host-versions` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn x_cdm_host_versions(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-host-versions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_cdm_host_versions_shim(val); self } #[doc = "Change the `x-cdm-interface-versions` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn x_cdm_interface_versions(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-interface-versions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_cdm_interface_versions_shim(val); self } #[doc = "Change the `x-cdm-module-versions` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub fn x_cdm_module_versions(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-module-versions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.x_cdm_module_versions_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WorkerOptions.rs b/crates/web-sys/src/features/gen_WorkerOptions.rs index a63503637b6..e3f9b1edee3 100644 --- a/crates/web-sys/src/features/gen_WorkerOptions.rs +++ b/crates/web-sys/src/features/gen_WorkerOptions.rs @@ -10,6 +10,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`*"] pub type WorkerOptions; + #[cfg(feature = "RequestCredentials")] + #[wasm_bindgen(method, setter = "credentials")] + fn credentials_shim(this: &WorkerOptions, val: RequestCredentials); + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &WorkerOptions, val: &str); + #[cfg(feature = "WorkerType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &WorkerOptions, val: WorkerType); } impl WorkerOptions { #[doc = "Construct a new `WorkerOptions`."] @@ -25,30 +33,14 @@ impl WorkerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkerOptions`*"] pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.credentials_shim(val); self } #[doc = "Change the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`*"] pub fn name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(feature = "WorkerType")] @@ -56,13 +48,7 @@ impl WorkerOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`, `WorkerType`*"] pub fn type_(&mut self, val: WorkerType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WorkletOptions.rs b/crates/web-sys/src/features/gen_WorkletOptions.rs index 12ce913b304..94b0e62f7ab 100644 --- a/crates/web-sys/src/features/gen_WorkletOptions.rs +++ b/crates/web-sys/src/features/gen_WorkletOptions.rs @@ -10,6 +10,9 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkletOptions`*"] pub type WorkletOptions; + #[cfg(feature = "RequestCredentials")] + #[wasm_bindgen(method, setter = "credentials")] + fn credentials_shim(this: &WorkletOptions, val: RequestCredentials); } impl WorkletOptions { #[doc = "Construct a new `WorkletOptions`."] @@ -25,17 +28,7 @@ impl WorkletOptions { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkletOptions`*"] pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.credentials_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_WriteParams.rs b/crates/web-sys/src/features/gen_WriteParams.rs index 06af78da20c..13223458c74 100644 --- a/crates/web-sys/src/features/gen_WriteParams.rs +++ b/crates/web-sys/src/features/gen_WriteParams.rs @@ -10,6 +10,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] pub type WriteParams; + #[wasm_bindgen(method, setter = "data")] + fn data_shim(this: &WriteParams, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "position")] + fn position_shim(this: &WriteParams, val: Option); + #[wasm_bindgen(method, setter = "size")] + fn size_shim(this: &WriteParams, val: Option); + #[cfg(feature = "WriteCommandType")] + #[wasm_bindgen(method, setter = "type")] + fn type__shim(this: &WriteParams, val: WriteCommandType); } impl WriteParams { #[cfg(feature = "WriteCommandType")] @@ -26,43 +35,21 @@ impl WriteParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] pub fn data(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.data_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } #[doc = "Change the `position` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] pub fn position(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("position"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.position_shim(val); self } #[doc = "Change the `size` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] pub fn size(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.size_shim(val); self } #[cfg(feature = "WriteCommandType")] @@ -70,13 +57,7 @@ impl WriteParams { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"] pub fn type_(&mut self, val: WriteCommandType) -> &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.type__shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XPathNsResolver.rs b/crates/web-sys/src/features/gen_XPathNsResolver.rs index 89ec857a336..4601c9df1fc 100644 --- a/crates/web-sys/src/features/gen_XPathNsResolver.rs +++ b/crates/web-sys/src/features/gen_XPathNsResolver.rs @@ -10,6 +10,8 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XPathNsResolver`*"] pub type XPathNsResolver; + #[wasm_bindgen(method, setter = "lookupNamespaceURI")] + fn lookup_namespace_uri_shim(this: &XPathNsResolver, val: &::js_sys::Function); } impl XPathNsResolver { #[doc = "Construct a new `XPathNsResolver`."] @@ -24,17 +26,7 @@ impl XPathNsResolver { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XPathNsResolver`*"] pub fn lookup_namespace_uri(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lookupNamespaceURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.lookup_namespace_uri_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs b/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs index 945817409c5..6f6712be78c 100644 --- a/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs +++ b/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs @@ -14,6 +14,18 @@ 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 type XrInputSourceEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &XrInputSourceEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &XrInputSourceEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &XrInputSourceEventInit, val: bool); + #[cfg(feature = "XrFrame")] + #[wasm_bindgen(method, setter = "frame")] + fn frame_shim(this: &XrInputSourceEventInit, val: &XrFrame); + #[cfg(feature = "XrInputSource")] + #[wasm_bindgen(method, setter = "inputSource")] + fn input_source_shim(this: &XrInputSourceEventInit, val: &XrInputSource); } #[cfg(web_sys_unstable_apis)] impl XrInputSourceEventInit { @@ -39,17 +51,7 @@ impl XrInputSourceEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -60,17 +62,7 @@ impl XrInputSourceEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -81,17 +73,7 @@ impl XrInputSourceEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -103,13 +85,7 @@ impl XrInputSourceEventInit { #[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 frame(&mut self, val: &XrFrame) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("frame"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.frame_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -121,17 +97,7 @@ impl XrInputSourceEventInit { #[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 input_source(&mut self, val: &XrInputSource) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inputSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.input_source_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs b/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs index e72dfe27583..849c940a1ad 100644 --- a/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs @@ -14,6 +14,19 @@ 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 type XrInputSourcesChangeEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &XrInputSourcesChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &XrInputSourcesChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &XrInputSourcesChangeEventInit, val: bool); + #[wasm_bindgen(method, setter = "added")] + fn added_shim(this: &XrInputSourcesChangeEventInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "removed")] + fn removed_shim(this: &XrInputSourcesChangeEventInit, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "XrSession")] + #[wasm_bindgen(method, setter = "session")] + fn session_shim(this: &XrInputSourcesChangeEventInit, val: &XrSession); } #[cfg(web_sys_unstable_apis)] impl XrInputSourcesChangeEventInit { @@ -44,17 +57,7 @@ impl XrInputSourcesChangeEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -65,17 +68,7 @@ impl XrInputSourcesChangeEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -86,17 +79,7 @@ impl XrInputSourcesChangeEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -107,13 +90,7 @@ impl XrInputSourcesChangeEventInit { #[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 added(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("added"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.added_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -124,17 +101,7 @@ impl XrInputSourcesChangeEventInit { #[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 removed(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("removed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.removed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -146,17 +113,7 @@ impl XrInputSourcesChangeEventInit { #[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 session(&mut self, val: &XrSession) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("session"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.session_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs b/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs index 8c494ca0a62..51d4adbfe9e 100644 --- a/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs @@ -14,6 +14,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 type XrPermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &XrPermissionDescriptor, val: PermissionName); + #[cfg(feature = "XrSessionMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &XrPermissionDescriptor, val: XrSessionMode); + #[wasm_bindgen(method, setter = "optionalFeatures")] + fn optional_features_shim(this: &XrPermissionDescriptor, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "requiredFeatures")] + fn required_features_shim(this: &XrPermissionDescriptor, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl XrPermissionDescriptor { @@ -39,13 +49,7 @@ impl XrPermissionDescriptor { #[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 name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +61,7 @@ impl XrPermissionDescriptor { #[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 mode(&mut self, val: XrSessionMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,17 +72,7 @@ impl XrPermissionDescriptor { #[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 optional_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.optional_features_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -95,17 +83,7 @@ impl XrPermissionDescriptor { #[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 required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requiredFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.required_features_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs b/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs index 46aa10bac48..4dbfb69ea22 100644 --- a/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs +++ b/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs @@ -14,6 +14,18 @@ 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 type XrReferenceSpaceEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &XrReferenceSpaceEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &XrReferenceSpaceEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &XrReferenceSpaceEventInit, val: bool); + #[cfg(feature = "XrReferenceSpace")] + #[wasm_bindgen(method, setter = "referenceSpace")] + fn reference_space_shim(this: &XrReferenceSpaceEventInit, val: &XrReferenceSpace); + #[cfg(feature = "XrRigidTransform")] + #[wasm_bindgen(method, setter = "transform")] + fn transform_shim(this: &XrReferenceSpaceEventInit, val: Option<&XrRigidTransform>); } #[cfg(web_sys_unstable_apis)] impl XrReferenceSpaceEventInit { @@ -38,17 +50,7 @@ impl XrReferenceSpaceEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +61,7 @@ impl XrReferenceSpaceEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +72,7 @@ impl XrReferenceSpaceEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,17 +84,7 @@ impl XrReferenceSpaceEventInit { #[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 reference_space(&mut self, val: &XrReferenceSpace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referenceSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.reference_space_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -124,17 +96,7 @@ impl XrReferenceSpaceEventInit { #[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 transform(&mut self, val: Option<&XrRigidTransform>) -> &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.transform_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrRenderStateInit.rs b/crates/web-sys/src/features/gen_XrRenderStateInit.rs index df8f9b82fb9..7b982dfa1dc 100644 --- a/crates/web-sys/src/features/gen_XrRenderStateInit.rs +++ b/crates/web-sys/src/features/gen_XrRenderStateInit.rs @@ -14,6 +14,17 @@ 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 type XrRenderStateInit; + #[cfg(feature = "XrWebGlLayer")] + #[wasm_bindgen(method, setter = "baseLayer")] + fn base_layer_shim(this: &XrRenderStateInit, val: Option<&XrWebGlLayer>); + #[wasm_bindgen(method, setter = "depthFar")] + fn depth_far_shim(this: &XrRenderStateInit, val: f64); + #[wasm_bindgen(method, setter = "depthNear")] + fn depth_near_shim(this: &XrRenderStateInit, val: f64); + #[wasm_bindgen(method, setter = "inlineVerticalFieldOfView")] + fn inline_vertical_field_of_view_shim(this: &XrRenderStateInit, val: f64); + #[wasm_bindgen(method, setter = "layers")] + fn layers_shim(this: &XrRenderStateInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl XrRenderStateInit { @@ -37,17 +48,7 @@ impl XrRenderStateInit { #[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 base_layer(&mut self, val: Option<&XrWebGlLayer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseLayer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.base_layer_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -58,17 +59,7 @@ impl XrRenderStateInit { #[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 depth_far(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthFar"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_far_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -79,17 +70,7 @@ impl XrRenderStateInit { #[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 depth_near(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthNear"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_near_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -100,17 +81,7 @@ impl XrRenderStateInit { #[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 inline_vertical_field_of_view(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inlineVerticalFieldOfView"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.inline_vertical_field_of_view_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -121,14 +92,7 @@ impl XrRenderStateInit { #[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 layers(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layers"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.layers_shim(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } } diff --git a/crates/web-sys/src/features/gen_XrSessionEventInit.rs b/crates/web-sys/src/features/gen_XrSessionEventInit.rs index 4a44c494526..56caaf616cf 100644 --- a/crates/web-sys/src/features/gen_XrSessionEventInit.rs +++ b/crates/web-sys/src/features/gen_XrSessionEventInit.rs @@ -14,6 +14,15 @@ 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 type XrSessionEventInit; + #[wasm_bindgen(method, setter = "bubbles")] + fn bubbles_shim(this: &XrSessionEventInit, val: bool); + #[wasm_bindgen(method, setter = "cancelable")] + fn cancelable_shim(this: &XrSessionEventInit, val: bool); + #[wasm_bindgen(method, setter = "composed")] + fn composed_shim(this: &XrSessionEventInit, val: bool); + #[cfg(feature = "XrSession")] + #[wasm_bindgen(method, setter = "session")] + fn session_shim(this: &XrSessionEventInit, val: &XrSession); } #[cfg(web_sys_unstable_apis)] impl XrSessionEventInit { @@ -38,17 +47,7 @@ impl XrSessionEventInit { #[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 bubbles(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bubbles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.bubbles_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -59,17 +58,7 @@ impl XrSessionEventInit { #[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 cancelable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cancelable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.cancelable_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -80,17 +69,7 @@ impl XrSessionEventInit { #[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 composed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("composed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.composed_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -102,17 +81,7 @@ impl XrSessionEventInit { #[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 session(&mut self, val: &XrSession) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("session"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.session_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrSessionInit.rs b/crates/web-sys/src/features/gen_XrSessionInit.rs index 39cbbd43be3..8bc078da63c 100644 --- a/crates/web-sys/src/features/gen_XrSessionInit.rs +++ b/crates/web-sys/src/features/gen_XrSessionInit.rs @@ -14,6 +14,10 @@ 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 type XrSessionInit; + #[wasm_bindgen(method, setter = "optionalFeatures")] + fn optional_features_shim(this: &XrSessionInit, val: &::wasm_bindgen::JsValue); + #[wasm_bindgen(method, setter = "requiredFeatures")] + fn required_features_shim(this: &XrSessionInit, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl XrSessionInit { @@ -36,17 +40,7 @@ impl XrSessionInit { #[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 optional_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.optional_features_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,17 +51,7 @@ impl XrSessionInit { #[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 required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requiredFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.required_features_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs b/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs index 8d354b79069..dc221e82d24 100644 --- a/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs @@ -14,6 +14,12 @@ 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 type XrSessionSupportedPermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[wasm_bindgen(method, setter = "name")] + fn name_shim(this: &XrSessionSupportedPermissionDescriptor, val: PermissionName); + #[cfg(feature = "XrSessionMode")] + #[wasm_bindgen(method, setter = "mode")] + fn mode_shim(this: &XrSessionSupportedPermissionDescriptor, val: XrSessionMode); } #[cfg(web_sys_unstable_apis)] impl XrSessionSupportedPermissionDescriptor { @@ -39,13 +45,7 @@ impl XrSessionSupportedPermissionDescriptor { #[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 name(&mut self, val: PermissionName) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.name_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -57,13 +57,7 @@ impl XrSessionSupportedPermissionDescriptor { #[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 mode(&mut self, val: XrSessionMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.mode_shim(val); self } } diff --git a/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs b/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs index 6de05291636..9fe4ef7a073 100644 --- a/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs +++ b/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs @@ -14,6 +14,18 @@ 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 type XrWebGlLayerInit; + #[wasm_bindgen(method, setter = "alpha")] + fn alpha_shim(this: &XrWebGlLayerInit, val: bool); + #[wasm_bindgen(method, setter = "antialias")] + fn antialias_shim(this: &XrWebGlLayerInit, val: bool); + #[wasm_bindgen(method, setter = "depth")] + fn depth_shim(this: &XrWebGlLayerInit, val: bool); + #[wasm_bindgen(method, setter = "framebufferScaleFactor")] + fn framebuffer_scale_factor_shim(this: &XrWebGlLayerInit, val: f64); + #[wasm_bindgen(method, setter = "ignoreDepthValues")] + fn ignore_depth_values_shim(this: &XrWebGlLayerInit, val: bool); + #[wasm_bindgen(method, setter = "stencil")] + fn stencil_shim(this: &XrWebGlLayerInit, val: bool); } #[cfg(web_sys_unstable_apis)] impl XrWebGlLayerInit { @@ -36,13 +48,7 @@ impl XrWebGlLayerInit { #[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 alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.alpha_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -53,17 +59,7 @@ impl XrWebGlLayerInit { #[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 antialias(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("antialias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.antialias_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -74,13 +70,7 @@ impl XrWebGlLayerInit { #[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 depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("depth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.depth_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -91,17 +81,7 @@ impl XrWebGlLayerInit { #[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 framebuffer_scale_factor(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framebufferScaleFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.framebuffer_scale_factor_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -112,17 +92,7 @@ impl XrWebGlLayerInit { #[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 ignore_depth_values(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreDepthValues"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.ignore_depth_values_shim(val); self } #[cfg(web_sys_unstable_apis)] @@ -133,17 +103,7 @@ impl XrWebGlLayerInit { #[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 stencil(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.stencil_shim(val); self } } diff --git a/crates/webidl/src/generator.rs b/crates/webidl/src/generator.rs index cf7e942cdc8..db8cff532ac 100644 --- a/crates/webidl/src/generator.rs +++ b/crates/webidl/src/generator.rs @@ -1,12 +1,15 @@ use proc_macro2::Literal; use proc_macro2::TokenStream; +use quote::format_ident; use quote::quote; use std::collections::BTreeSet; use syn::{Ident, Type}; +use wasm_bindgen_backend::util::leading_colon_path_ty; use wasm_bindgen_backend::util::{raw_ident, rust_ident}; use crate::constants::{BUILTIN_IDENTS, POLYFILL_INTERFACES}; use crate::traverse::TraverseType; +use crate::util::shared_ref; use crate::util::{get_cfg_features, mdn_doc, required_doc_string, snake_case_ident}; use crate::Options; @@ -625,16 +628,50 @@ pub struct DictionaryField { pub name: Ident, pub js_name: String, pub ty: Type, + pub is_js_value_ref_option_type: bool, pub required: bool, pub unstable: bool, } impl DictionaryField { - fn generate_rust(&self, options: &Options, parent_name: String) -> TokenStream { + fn generate_rust_shim( + &self, + parent_ident: &Ident, + cfg_features: &Option, + ) -> TokenStream { + let ty = &self.ty; + let shim_name = self.shim_name(); + let js_name = &self.js_name; + + let js_value_ref_type = shared_ref( + leading_colon_path_ty(vec![rust_ident("wasm_bindgen"), rust_ident("JsValue")]), + false, + ); + + let ty = if self.is_js_value_ref_option_type { + js_value_ref_type + } else { + ty.clone() + }; + + quote! { + #cfg_features + #[wasm_bindgen(method, setter = #js_name)] + fn #shim_name(this: &#parent_ident, val: #ty); + } + } + + fn generate_rust_setter( + &self, + options: &Options, + features: &BTreeSet, + cfg_features: &Option, + ) -> TokenStream { let DictionaryField { name, js_name, ty, + is_js_value_ref_option_type: _, required: _, unstable, } = self; @@ -642,39 +679,52 @@ impl DictionaryField { let unstable_attr = maybe_unstable_attr(*unstable); let unstable_docs = maybe_unstable_docs(*unstable); - let mut features = BTreeSet::new(); - - add_features(&mut features, ty); - - features.remove(&parent_name); - - let cfg_features = get_cfg_features(options, &features); - - features.insert(parent_name); - let doc_comment = comment( format!("Change the `{}` field of this object.", js_name), - &required_doc_string(options, &features), + &required_doc_string(options, features), ); + let shim_name = self.shim_name(); + + let shim_args = if self.is_js_value_ref_option_type { + quote! { val.unwrap_or(&::wasm_bindgen::JsValue::NULL) } + } else { + quote! { val } + }; + quote! { #unstable_attr #cfg_features #doc_comment #unstable_docs pub fn #name(&mut self, val: #ty) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from(#js_name), - &JsValue::from(val), - ); - debug_assert!(r.is_ok(), "setting properties should never fail on our dictionary objects"); - let _ = r; + self.#shim_name(#shim_args); self } } } + + fn features( + &self, + options: &Options, + parent_name: String, + ) -> (BTreeSet, Option) { + let mut features = BTreeSet::new(); + + add_features(&mut features, &self.ty); + + features.remove(&parent_name); + + let cfg_features = get_cfg_features(options, &features); + + features.insert(parent_name); + + (features, cfg_features) + } + + fn shim_name(&self) -> Ident { + format_ident!("{}_shim", self.name) + } } pub struct Dictionary { @@ -727,9 +777,24 @@ impl Dictionary { &required_doc_string(options, &required_features), ); + let (field_features, field_cfg_features): (Vec<_>, Vec<_>) = fields + .iter() + .map(|field| field.features(options, name.to_string())) + .unzip(); + + let field_shims = fields + .iter() + .zip(field_cfg_features.iter()) + .map(|(field, cfg_features)| field.generate_rust_shim(name, cfg_features)) + .collect::>(); + let fields = fields .iter() - .map(|field| field.generate_rust(options, name.to_string())) + .zip(field_features.iter()) + .zip(field_cfg_features.iter()) + .map(|((field, features), cfg_features)| { + field.generate_rust_setter(options, features, cfg_features) + }) .collect::>(); let mut base_stream = quote! { @@ -746,6 +811,8 @@ impl Dictionary { #doc_comment #unstable_docs pub type #name; + + #(#field_shims)* } #unstable_attr diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 21c93f32eec..6bd02dfcdee 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -30,6 +30,7 @@ use crate::util::{ }; use anyhow::Context; use anyhow::Result; +use idl_type::IdlType; use proc_macro2::{Ident, TokenStream}; use quote::ToTokens; use sourcefile::SourceFile; @@ -376,10 +377,22 @@ impl<'src> FirstPassRecord<'src> { false => is_type_unstable(&field.type_, unstable_types), }; + let idl_type = field.type_.to_idl_type(self); + + let is_js_value_ref_option_type = match &idl_type { + idl_type::IdlType::Nullable(ty) => match **ty { + idl_type::IdlType::Any => true, + IdlType::FrozenArray(ref _idl_type) | IdlType::Sequence(ref _idl_type) => true, + idl_type::IdlType::Union(ref types) => !types + .iter() + .all(|idl_type| matches!(idl_type, IdlType::Interface(..))), + _ => false, + }, + _ => false, + }; + // use argument position now as we're just binding setters - let ty = field - .type_ - .to_idl_type(self) + let ty = idl_type .to_syn_type(TypePosition::Argument) .unwrap_or(None)?; @@ -424,6 +437,7 @@ impl<'src> FirstPassRecord<'src> { name: rust_ident(&snake_case_ident(field.identifier.0)), js_name: field.identifier.0.to_string(), ty, + is_js_value_ref_option_type, unstable: unstable_override, }) } @@ -767,6 +781,7 @@ impl<'src> FirstPassRecord<'src> { .to_syn_type(pos) .unwrap() .unwrap(), + is_js_value_ref_option_type: false, unstable: false, }) }