Skip to main content

web_sys/features/
gen_HidReportInfo.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 = HIDReportInfo)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `HidReportInfo` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`*"]
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 HidReportInfo;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "HidReportItem")]
19    #[doc = "Get the `items` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`, `HidReportItem`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "items")]
26    pub fn get_items(this: &HidReportInfo) -> Option<::js_sys::Array<HidReportItem>>;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "HidReportItem")]
29    #[doc = "Change the `items` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`, `HidReportItem`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "items")]
36    pub fn set_items(this: &HidReportInfo, val: &[HidReportItem]);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `reportId` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "reportId")]
45    pub fn get_report_id(this: &HidReportInfo) -> Option<u8>;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `reportId` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `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 = "reportId")]
54    pub fn set_report_id(this: &HidReportInfo, val: u8);
55}
56#[cfg(web_sys_unstable_apis)]
57impl HidReportInfo {
58    #[doc = "Construct a new `HidReportInfo`."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`*"]
61    #[doc = ""]
62    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    pub fn new() -> Self {
65        #[allow(unused_mut)]
66        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
67        ret
68    }
69    #[cfg(web_sys_unstable_apis)]
70    #[cfg(feature = "HidReportItem")]
71    #[deprecated = "Use `set_items()` instead."]
72    pub fn items(&mut self, val: &[HidReportItem]) -> &mut Self {
73        self.set_items(val);
74        self
75    }
76    #[cfg(web_sys_unstable_apis)]
77    #[deprecated = "Use `set_report_id()` instead."]
78    pub fn report_id(&mut self, val: u8) -> &mut Self {
79        self.set_report_id(val);
80        self
81    }
82}
83#[cfg(web_sys_unstable_apis)]
84impl Default for HidReportInfo {
85    fn default() -> Self {
86        Self::new()
87    }
88}