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 = BluetoothPermissionStorage)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `BluetoothPermissionStorage` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"]
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 BluetoothPermissionStorage;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl BluetoothPermissionStorage {
19     #[doc = "Construct a new `BluetoothPermissionStorage`."]
20     #[doc = ""]
21     #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"]
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(allowed_devices: &::wasm_bindgen::JsValue) -> Self25     pub fn new(allowed_devices: &::wasm_bindgen::JsValue) -> Self {
26         #[allow(unused_mut)]
27         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28         ret.allowed_devices(allowed_devices);
29         ret
30     }
31     #[cfg(web_sys_unstable_apis)]
32     #[doc = "Change the `allowedDevices` field of this object."]
33     #[doc = ""]
34     #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"]
35     #[doc = ""]
36     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
37     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self38     pub fn allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
39         use wasm_bindgen::JsValue;
40         let r = ::js_sys::Reflect::set(
41             self.as_ref(),
42             &JsValue::from("allowedDevices"),
43             &JsValue::from(val),
44         );
45         debug_assert!(
46             r.is_ok(),
47             "setting properties should never fail on our dictionary objects"
48         );
49         let _ = r;
50         self
51     }
52 }
53