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 = HIDDeviceFilter)] 8 #[derive(Debug, Clone, PartialEq, Eq)] 9 #[doc = "The `HidDeviceFilter` dictionary."] 10 #[doc = ""] 11 #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] 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 HidDeviceFilter; 16 } 17 #[cfg(web_sys_unstable_apis)] 18 impl HidDeviceFilter { 19 #[doc = "Construct a new `HidDeviceFilter`."] 20 #[doc = ""] 21 #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] 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 `productId` field of this object."] 32 #[doc = ""] 33 #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] 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)*"] product_id(&mut self, val: u16) -> &mut Self37 pub fn product_id(&mut self, val: u16) -> &mut Self { 38 use wasm_bindgen::JsValue; 39 let r = ::js_sys::Reflect::set( 40 self.as_ref(), 41 &JsValue::from("productId"), 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 `usage` field of this object."] 53 #[doc = ""] 54 #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] 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)*"] usage(&mut self, val: u16) -> &mut Self58 pub fn usage(&mut self, val: u16) -> &mut Self { 59 use wasm_bindgen::JsValue; 60 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); 61 debug_assert!( 62 r.is_ok(), 63 "setting properties should never fail on our dictionary objects" 64 ); 65 let _ = r; 66 self 67 } 68 #[cfg(web_sys_unstable_apis)] 69 #[doc = "Change the `usagePage` field of this object."] 70 #[doc = ""] 71 #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] 72 #[doc = ""] 73 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 74 #[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 Self75 pub fn usage_page(&mut self, val: u16) -> &mut Self { 76 use wasm_bindgen::JsValue; 77 let r = ::js_sys::Reflect::set( 78 self.as_ref(), 79 &JsValue::from("usagePage"), 80 &JsValue::from(val), 81 ); 82 debug_assert!( 83 r.is_ok(), 84 "setting properties should never fail on our dictionary objects" 85 ); 86 let _ = r; 87 self 88 } 89 #[cfg(web_sys_unstable_apis)] 90 #[doc = "Change the `vendorId` field of this object."] 91 #[doc = ""] 92 #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] 93 #[doc = ""] 94 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 95 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] vendor_id(&mut self, val: u32) -> &mut Self96 pub fn vendor_id(&mut self, val: u32) -> &mut Self { 97 use wasm_bindgen::JsValue; 98 let r = ::js_sys::Reflect::set( 99 self.as_ref(), 100 &JsValue::from("vendorId"), 101 &JsValue::from(val), 102 ); 103 debug_assert!( 104 r.is_ok(), 105 "setting properties should never fail on our dictionary objects" 106 ); 107 let _ = r; 108 self 109 } 110 } 111 #[cfg(web_sys_unstable_apis)] 112 impl Default for HidDeviceFilter { default() -> Self113 fn default() -> Self { 114 Self::new() 115 } 116 } 117