maxcountryman_web_sys/features/
gen_XrInputSourcesChangeEventInit.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRInputSourcesChangeEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `XrInputSourcesChangeEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"]
12    #[doc = ""]
13    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15    pub type XrInputSourcesChangeEventInit;
16}
17#[cfg(web_sys_unstable_apis)]
18impl XrInputSourcesChangeEventInit {
19    #[cfg(feature = "XrSession")]
20    #[doc = "Construct a new `XrInputSourcesChangeEventInit`."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`, `XrSession`*"]
23    #[doc = ""]
24    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
26    pub fn new(
27        added: &::wasm_bindgen::JsValue,
28        removed: &::wasm_bindgen::JsValue,
29        session: &XrSession,
30    ) -> Self {
31        #[allow(unused_mut)]
32        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
33        ret.added(added);
34        ret.removed(removed);
35        ret.session(session);
36        ret
37    }
38    #[cfg(web_sys_unstable_apis)]
39    #[doc = "Change the `bubbles` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"]
42    #[doc = ""]
43    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
45    pub fn bubbles(&mut self, val: bool) -> &mut Self {
46        use wasm_bindgen::JsValue;
47        let r = ::js_sys::Reflect::set(
48            self.as_ref(),
49            &JsValue::from("bubbles"),
50            &JsValue::from(val),
51        );
52        debug_assert!(
53            r.is_ok(),
54            "setting properties should never fail on our dictionary objects"
55        );
56        let _ = r;
57        self
58    }
59    #[cfg(web_sys_unstable_apis)]
60    #[doc = "Change the `cancelable` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"]
63    #[doc = ""]
64    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
65    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
66    pub fn cancelable(&mut self, val: bool) -> &mut Self {
67        use wasm_bindgen::JsValue;
68        let r = ::js_sys::Reflect::set(
69            self.as_ref(),
70            &JsValue::from("cancelable"),
71            &JsValue::from(val),
72        );
73        debug_assert!(
74            r.is_ok(),
75            "setting properties should never fail on our dictionary objects"
76        );
77        let _ = r;
78        self
79    }
80    #[cfg(web_sys_unstable_apis)]
81    #[doc = "Change the `composed` field of this object."]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"]
84    #[doc = ""]
85    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    pub fn composed(&mut self, val: bool) -> &mut Self {
88        use wasm_bindgen::JsValue;
89        let r = ::js_sys::Reflect::set(
90            self.as_ref(),
91            &JsValue::from("composed"),
92            &JsValue::from(val),
93        );
94        debug_assert!(
95            r.is_ok(),
96            "setting properties should never fail on our dictionary objects"
97        );
98        let _ = r;
99        self
100    }
101    #[cfg(web_sys_unstable_apis)]
102    #[doc = "Change the `added` field of this object."]
103    #[doc = ""]
104    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"]
105    #[doc = ""]
106    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
107    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
108    pub fn added(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
109        use wasm_bindgen::JsValue;
110        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("added"), &JsValue::from(val));
111        debug_assert!(
112            r.is_ok(),
113            "setting properties should never fail on our dictionary objects"
114        );
115        let _ = r;
116        self
117    }
118    #[cfg(web_sys_unstable_apis)]
119    #[doc = "Change the `removed` field of this object."]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"]
122    #[doc = ""]
123    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
125    pub fn removed(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
126        use wasm_bindgen::JsValue;
127        let r = ::js_sys::Reflect::set(
128            self.as_ref(),
129            &JsValue::from("removed"),
130            &JsValue::from(val),
131        );
132        debug_assert!(
133            r.is_ok(),
134            "setting properties should never fail on our dictionary objects"
135        );
136        let _ = r;
137        self
138    }
139    #[cfg(web_sys_unstable_apis)]
140    #[cfg(feature = "XrSession")]
141    #[doc = "Change the `session` field of this object."]
142    #[doc = ""]
143    #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`, `XrSession`*"]
144    #[doc = ""]
145    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
146    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
147    pub fn session(&mut self, val: &XrSession) -> &mut Self {
148        use wasm_bindgen::JsValue;
149        let r = ::js_sys::Reflect::set(
150            self.as_ref(),
151            &JsValue::from("session"),
152            &JsValue::from(val),
153        );
154        debug_assert!(
155            r.is_ok(),
156            "setting properties should never fail on our dictionary objects"
157        );
158        let _ = r;
159        self
160    }
161}