1 #![allow(unused_imports)] 2 use super::*; 3 use wasm_bindgen::prelude::*; 4 #[cfg(web_sys_unstable_apis)] 5 #[wasm_bindgen] 6 extern "C" { 7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = HIDCollectionInfo)] 8 #[derive(Debug, Clone, PartialEq, Eq)] 9 #[doc = "The `HidCollectionInfo` dictionary."] 10 #[doc = ""] 11 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 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 HidCollectionInfo; 16 } 17 #[cfg(web_sys_unstable_apis)] 18 impl HidCollectionInfo { 19 #[doc = "Construct a new `HidCollectionInfo`."] 20 #[doc = ""] 21 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] new() -> Self25 pub fn new() -> Self { 26 #[allow(unused_mut)] 27 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); 28 ret 29 } 30 #[cfg(web_sys_unstable_apis)] 31 #[doc = "Change the `children` field of this object."] 32 #[doc = ""] 33 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 34 #[doc = ""] 35 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 36 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] children(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self37 pub fn children(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 38 use wasm_bindgen::JsValue; 39 let r = ::js_sys::Reflect::set( 40 self.as_ref(), 41 &JsValue::from("children"), 42 &JsValue::from(val), 43 ); 44 debug_assert!( 45 r.is_ok(), 46 "setting properties should never fail on our dictionary objects" 47 ); 48 let _ = r; 49 self 50 } 51 #[cfg(web_sys_unstable_apis)] 52 #[doc = "Change the `featureReports` field of this object."] 53 #[doc = ""] 54 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 55 #[doc = ""] 56 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 57 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] feature_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self58 pub fn feature_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 59 use wasm_bindgen::JsValue; 60 let r = ::js_sys::Reflect::set( 61 self.as_ref(), 62 &JsValue::from("featureReports"), 63 &JsValue::from(val), 64 ); 65 debug_assert!( 66 r.is_ok(), 67 "setting properties should never fail on our dictionary objects" 68 ); 69 let _ = r; 70 self 71 } 72 #[cfg(web_sys_unstable_apis)] 73 #[doc = "Change the `inputReports` field of this object."] 74 #[doc = ""] 75 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 76 #[doc = ""] 77 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 78 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] input_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self79 pub fn input_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 80 use wasm_bindgen::JsValue; 81 let r = ::js_sys::Reflect::set( 82 self.as_ref(), 83 &JsValue::from("inputReports"), 84 &JsValue::from(val), 85 ); 86 debug_assert!( 87 r.is_ok(), 88 "setting properties should never fail on our dictionary objects" 89 ); 90 let _ = r; 91 self 92 } 93 #[cfg(web_sys_unstable_apis)] 94 #[doc = "Change the `outputReports` field of this object."] 95 #[doc = ""] 96 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 97 #[doc = ""] 98 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 99 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] output_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self100 pub fn output_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 101 use wasm_bindgen::JsValue; 102 let r = ::js_sys::Reflect::set( 103 self.as_ref(), 104 &JsValue::from("outputReports"), 105 &JsValue::from(val), 106 ); 107 debug_assert!( 108 r.is_ok(), 109 "setting properties should never fail on our dictionary objects" 110 ); 111 let _ = r; 112 self 113 } 114 #[cfg(web_sys_unstable_apis)] 115 #[doc = "Change the `type` field of this object."] 116 #[doc = ""] 117 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 118 #[doc = ""] 119 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 120 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] type_(&mut self, val: u8) -> &mut Self121 pub fn type_(&mut self, val: u8) -> &mut Self { 122 use wasm_bindgen::JsValue; 123 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); 124 debug_assert!( 125 r.is_ok(), 126 "setting properties should never fail on our dictionary objects" 127 ); 128 let _ = r; 129 self 130 } 131 #[cfg(web_sys_unstable_apis)] 132 #[doc = "Change the `usage` 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] usage(&mut self, val: u16) -> &mut Self138 pub fn usage(&mut self, val: u16) -> &mut Self { 139 use wasm_bindgen::JsValue; 140 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); 141 debug_assert!( 142 r.is_ok(), 143 "setting properties should never fail on our dictionary objects" 144 ); 145 let _ = r; 146 self 147 } 148 #[cfg(web_sys_unstable_apis)] 149 #[doc = "Change the `usagePage` field of this object."] 150 #[doc = ""] 151 #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] 152 #[doc = ""] 153 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 154 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] usage_page(&mut self, val: u16) -> &mut Self155 pub fn usage_page(&mut self, val: u16) -> &mut Self { 156 use wasm_bindgen::JsValue; 157 let r = ::js_sys::Reflect::set( 158 self.as_ref(), 159 &JsValue::from("usagePage"), 160 &JsValue::from(val), 161 ); 162 debug_assert!( 163 r.is_ok(), 164 "setting properties should never fail on our dictionary objects" 165 ); 166 let _ = r; 167 self 168 } 169 } 170 #[cfg(web_sys_unstable_apis)] 171 impl Default for HidCollectionInfo { default() -> Self172 fn default() -> Self { 173 Self::new() 174 } 175 } 176