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 = USBPermissionDescriptor)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `UsbPermissionDescriptor` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `UsbPermissionDescriptor`*"]
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 UsbPermissionDescriptor;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl UsbPermissionDescriptor {
19     #[cfg(feature = "PermissionName")]
20     #[doc = "Construct a new `UsbPermissionDescriptor`."]
21     #[doc = ""]
22     #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `UsbPermissionDescriptor`*"]
23     #[doc = ""]
24     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
new(name: PermissionName) -> Self26     pub fn new(name: PermissionName) -> Self {
27         #[allow(unused_mut)]
28         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29         ret.name(name);
30         ret
31     }
32     #[cfg(web_sys_unstable_apis)]
33     #[cfg(feature = "PermissionName")]
34     #[doc = "Change the `name` field of this object."]
35     #[doc = ""]
36     #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `UsbPermissionDescriptor`*"]
37     #[doc = ""]
38     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
name(&mut self, val: PermissionName) -> &mut Self40     pub fn name(&mut self, val: PermissionName) -> &mut Self {
41         use wasm_bindgen::JsValue;
42         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
43         debug_assert!(
44             r.is_ok(),
45             "setting properties should never fail on our dictionary objects"
46         );
47         let _ = r;
48         self
49     }
50     #[cfg(web_sys_unstable_apis)]
51     #[doc = "Change the `filters` field of this object."]
52     #[doc = ""]
53     #[doc = "*This API requires the following crate features to be activated: `UsbPermissionDescriptor`*"]
54     #[doc = ""]
55     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self57     pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
58         use wasm_bindgen::JsValue;
59         let r = ::js_sys::Reflect::set(
60             self.as_ref(),
61             &JsValue::from("filters"),
62             &JsValue::from(val),
63         );
64         debug_assert!(
65             r.is_ok(),
66             "setting properties should never fail on our dictionary objects"
67         );
68         let _ = r;
69         self
70     }
71 }
72