web_sys/features/
gen_BluetoothPermissionStorage.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothPermissionStorage)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `BluetoothPermissionStorage` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"]
13 #[doc = ""]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type BluetoothPermissionStorage;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "AllowedBluetoothDevice")]
19 #[doc = "Get the `allowedDevices` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`, `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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25 #[wasm_bindgen(method, getter = "allowedDevices")]
26 pub fn get_allowed_devices(
27 this: &BluetoothPermissionStorage,
28 ) -> ::js_sys::Array<AllowedBluetoothDevice>;
29 #[cfg(web_sys_unstable_apis)]
30 #[cfg(feature = "AllowedBluetoothDevice")]
31 #[doc = "Change the `allowedDevices` field of this object."]
32 #[doc = ""]
33 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`, `BluetoothPermissionStorage`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
37 #[wasm_bindgen(method, setter = "allowedDevices")]
38 pub fn set_allowed_devices(this: &BluetoothPermissionStorage, val: &[AllowedBluetoothDevice]);
39}
40#[cfg(web_sys_unstable_apis)]
41impl BluetoothPermissionStorage {
42 #[cfg(feature = "AllowedBluetoothDevice")]
43 #[doc = "Construct a new `BluetoothPermissionStorage`."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`, `BluetoothPermissionStorage`*"]
46 #[doc = ""]
47 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
48 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
49 pub fn new(allowed_devices: &[AllowedBluetoothDevice]) -> Self {
50 #[allow(unused_mut)]
51 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
52 ret.set_allowed_devices(allowed_devices);
53 ret
54 }
55 #[cfg(web_sys_unstable_apis)]
56 #[cfg(feature = "AllowedBluetoothDevice")]
57 #[deprecated = "Use `set_allowed_devices()` instead."]
58 pub fn allowed_devices(&mut self, val: &[AllowedBluetoothDevice]) -> &mut Self {
59 self.set_allowed_devices(val);
60 self
61 }
62}