]>
git.proxmox.com Git - rustc.git/blob - vendor/web-sys/src/features/gen_HidInputReportEventInit.rs
1 #![allow(unused_imports)]
4 use wasm_bindgen
::prelude
::*;
5 #[cfg(web_sys_unstable_apis)]
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = HIDInputReportEventInit)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `HidInputReportEventInit` dictionary."]
12 #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"]
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
;
18 #[cfg(web_sys_unstable_apis)]
19 impl HidInputReportEventInit
{
20 #[cfg(feature = "HidDevice")]
21 #[doc = "Construct a new `HidInputReportEventInit`."]
23 #[doc = "*This API requires the following crate features to be activated: `HidDevice`, `HidInputReportEventInit`*"]
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 {
29 let mut ret
: Self = ::wasm_bindgen
::JsCast
::unchecked_into(::js_sys
::Object
::new());
32 ret
.report_id(report_id
);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Change the `bubbles` field of this object."]
38 #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"]
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(
46 &JsValue
::from("bubbles"),
51 "setting properties should never fail on our dictionary objects"
56 #[cfg(web_sys_unstable_apis)]
57 #[doc = "Change the `cancelable` field of this object."]
59 #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"]
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(
67 &JsValue
::from("cancelable"),
72 "setting properties should never fail on our dictionary objects"
77 #[cfg(web_sys_unstable_apis)]
78 #[doc = "Change the `composed` field of this object."]
80 #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"]
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(
88 &JsValue
::from("composed"),
93 "setting properties should never fail on our dictionary objects"
98 #[cfg(web_sys_unstable_apis)]
99 #[doc = "Change the `data` field of this object."]
101 #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"]
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
));
110 "setting properties should never fail on our dictionary objects"
115 #[cfg(web_sys_unstable_apis)]
116 #[cfg(feature = "HidDevice")]
117 #[doc = "Change the `device` field of this object."]
119 #[doc = "*This API requires the following crate features to be activated: `HidDevice`, `HidInputReportEventInit`*"]
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
;
126 ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("device"), &JsValue
::from(val
));
129 "setting properties should never fail on our dictionary objects"
134 #[cfg(web_sys_unstable_apis)]
135 #[doc = "Change the `reportId` field of this object."]
137 #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"]
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(
145 &JsValue
::from("reportId"),
150 "setting properties should never fail on our dictionary objects"