Skip to main content

web_sys/features/
gen_HidCollectionInfo.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = HIDCollectionInfo)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `HidCollectionInfo` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type HidCollectionInfo;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `children` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "children")]
25    pub fn get_children(this: &HidCollectionInfo) -> Option<::js_sys::Array<HidCollectionInfo>>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `children` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "children")]
34    pub fn set_children(this: &HidCollectionInfo, val: &[HidCollectionInfo]);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "HidReportInfo")]
37    #[doc = "Get the `featureReports` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidReportInfo`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "featureReports")]
44    pub fn get_feature_reports(this: &HidCollectionInfo) -> Option<::js_sys::Array<HidReportInfo>>;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "HidReportInfo")]
47    #[doc = "Change the `featureReports` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidReportInfo`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "featureReports")]
54    pub fn set_feature_reports(this: &HidCollectionInfo, val: &[HidReportInfo]);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "HidReportInfo")]
57    #[doc = "Get the `inputReports` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidReportInfo`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, getter = "inputReports")]
64    pub fn get_input_reports(this: &HidCollectionInfo) -> Option<::js_sys::Array<HidReportInfo>>;
65    #[cfg(web_sys_unstable_apis)]
66    #[cfg(feature = "HidReportInfo")]
67    #[doc = "Change the `inputReports` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidReportInfo`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, setter = "inputReports")]
74    pub fn set_input_reports(this: &HidCollectionInfo, val: &[HidReportInfo]);
75    #[cfg(web_sys_unstable_apis)]
76    #[cfg(feature = "HidReportInfo")]
77    #[doc = "Get the `outputReports` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidReportInfo`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    #[wasm_bindgen(method, getter = "outputReports")]
84    pub fn get_output_reports(this: &HidCollectionInfo) -> Option<::js_sys::Array<HidReportInfo>>;
85    #[cfg(web_sys_unstable_apis)]
86    #[cfg(feature = "HidReportInfo")]
87    #[doc = "Change the `outputReports` field of this object."]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`, `HidReportInfo`*"]
90    #[doc = ""]
91    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93    #[wasm_bindgen(method, setter = "outputReports")]
94    pub fn set_output_reports(this: &HidCollectionInfo, val: &[HidReportInfo]);
95    #[cfg(web_sys_unstable_apis)]
96    #[doc = "Get the `type` field of this object."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
99    #[doc = ""]
100    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
101    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
102    #[wasm_bindgen(method, getter = "type")]
103    pub fn get_type(this: &HidCollectionInfo) -> Option<u8>;
104    #[cfg(web_sys_unstable_apis)]
105    #[doc = "Change the `type` field of this object."]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
108    #[doc = ""]
109    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
110    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
111    #[wasm_bindgen(method, setter = "type")]
112    pub fn set_type(this: &HidCollectionInfo, val: u8);
113    #[cfg(web_sys_unstable_apis)]
114    #[doc = "Get the `usage` field of this object."]
115    #[doc = ""]
116    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
117    #[doc = ""]
118    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
119    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
120    #[wasm_bindgen(method, getter = "usage")]
121    pub fn get_usage(this: &HidCollectionInfo) -> Option<u16>;
122    #[cfg(web_sys_unstable_apis)]
123    #[doc = "Change the `usage` field of this object."]
124    #[doc = ""]
125    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
126    #[doc = ""]
127    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
128    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
129    #[wasm_bindgen(method, setter = "usage")]
130    pub fn set_usage(this: &HidCollectionInfo, val: u16);
131    #[cfg(web_sys_unstable_apis)]
132    #[doc = "Get the `usagePage` field of this object."]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
135    #[doc = ""]
136    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
137    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
138    #[wasm_bindgen(method, getter = "usagePage")]
139    pub fn get_usage_page(this: &HidCollectionInfo) -> Option<u16>;
140    #[cfg(web_sys_unstable_apis)]
141    #[doc = "Change the `usagePage` field of this object."]
142    #[doc = ""]
143    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
147    #[wasm_bindgen(method, setter = "usagePage")]
148    pub fn set_usage_page(this: &HidCollectionInfo, val: u16);
149}
150#[cfg(web_sys_unstable_apis)]
151impl HidCollectionInfo {
152    #[doc = "Construct a new `HidCollectionInfo`."]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"]
155    #[doc = ""]
156    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
157    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
158    pub fn new() -> Self {
159        #[allow(unused_mut)]
160        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
161        ret
162    }
163    #[cfg(web_sys_unstable_apis)]
164    #[deprecated = "Use `set_children()` instead."]
165    pub fn children(&mut self, val: &[HidCollectionInfo]) -> &mut Self {
166        self.set_children(val);
167        self
168    }
169    #[cfg(web_sys_unstable_apis)]
170    #[cfg(feature = "HidReportInfo")]
171    #[deprecated = "Use `set_feature_reports()` instead."]
172    pub fn feature_reports(&mut self, val: &[HidReportInfo]) -> &mut Self {
173        self.set_feature_reports(val);
174        self
175    }
176    #[cfg(web_sys_unstable_apis)]
177    #[cfg(feature = "HidReportInfo")]
178    #[deprecated = "Use `set_input_reports()` instead."]
179    pub fn input_reports(&mut self, val: &[HidReportInfo]) -> &mut Self {
180        self.set_input_reports(val);
181        self
182    }
183    #[cfg(web_sys_unstable_apis)]
184    #[cfg(feature = "HidReportInfo")]
185    #[deprecated = "Use `set_output_reports()` instead."]
186    pub fn output_reports(&mut self, val: &[HidReportInfo]) -> &mut Self {
187        self.set_output_reports(val);
188        self
189    }
190    #[cfg(web_sys_unstable_apis)]
191    #[deprecated = "Use `set_type()` instead."]
192    pub fn type_(&mut self, val: u8) -> &mut Self {
193        self.set_type(val);
194        self
195    }
196    #[cfg(web_sys_unstable_apis)]
197    #[deprecated = "Use `set_usage()` instead."]
198    pub fn usage(&mut self, val: u16) -> &mut Self {
199        self.set_usage(val);
200        self
201    }
202    #[cfg(web_sys_unstable_apis)]
203    #[deprecated = "Use `set_usage_page()` instead."]
204    pub fn usage_page(&mut self, val: u16) -> &mut Self {
205        self.set_usage_page(val);
206        self
207    }
208}
209#[cfg(web_sys_unstable_apis)]
210impl Default for HidCollectionInfo {
211    fn default() -> Self {
212        Self::new()
213    }
214}