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