Skip to main content

web_sys/features/
gen_BluetoothPermissionDescriptor.rs

1#![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(
9        extends = "::js_sys::Object",
10        js_name = "BluetoothPermissionDescriptor"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `BluetoothPermissionDescriptor` dictionary."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
16    #[doc = ""]
17    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
18    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
19    pub type BluetoothPermissionDescriptor;
20    #[cfg(web_sys_unstable_apis)]
21    #[cfg(feature = "PermissionName")]
22    #[doc = "Get the `name` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"]
25    #[doc = ""]
26    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
27    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
28    #[wasm_bindgen(method, getter = "name")]
29    pub fn get_name(this: &BluetoothPermissionDescriptor) -> PermissionName;
30    #[cfg(web_sys_unstable_apis)]
31    #[cfg(feature = "PermissionName")]
32    #[doc = "Change the `name` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
38    #[wasm_bindgen(method, setter = "name")]
39    pub fn set_name(this: &BluetoothPermissionDescriptor, val: PermissionName);
40    #[cfg(web_sys_unstable_apis)]
41    #[doc = "Get the `acceptAllDevices` field of this object."]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
44    #[doc = ""]
45    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
46    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
47    #[wasm_bindgen(method, getter = "acceptAllDevices")]
48    pub fn get_accept_all_devices(this: &BluetoothPermissionDescriptor) -> Option<bool>;
49    #[cfg(web_sys_unstable_apis)]
50    #[doc = "Change the `acceptAllDevices` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
53    #[doc = ""]
54    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
56    #[wasm_bindgen(method, setter = "acceptAllDevices")]
57    pub fn set_accept_all_devices(this: &BluetoothPermissionDescriptor, val: bool);
58    #[cfg(web_sys_unstable_apis)]
59    #[doc = "Get the `deviceId` field of this object."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
62    #[doc = ""]
63    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
64    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
65    #[wasm_bindgen(method, getter = "deviceId")]
66    pub fn get_device_id(this: &BluetoothPermissionDescriptor) -> Option<::alloc::string::String>;
67    #[cfg(web_sys_unstable_apis)]
68    #[doc = "Change the `deviceId` field of this object."]
69    #[doc = ""]
70    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
71    #[doc = ""]
72    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
73    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
74    #[wasm_bindgen(method, setter = "deviceId")]
75    pub fn set_device_id(this: &BluetoothPermissionDescriptor, val: &str);
76    #[cfg(web_sys_unstable_apis)]
77    #[cfg(feature = "BluetoothLeScanFilterInit")]
78    #[doc = "Get the `filters` field of this object."]
79    #[doc = ""]
80    #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`, `BluetoothPermissionDescriptor`*"]
81    #[doc = ""]
82    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
83    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
84    #[wasm_bindgen(method, getter = "filters")]
85    pub fn get_filters(
86        this: &BluetoothPermissionDescriptor,
87    ) -> Option<::js_sys::Array<BluetoothLeScanFilterInit>>;
88    #[cfg(web_sys_unstable_apis)]
89    #[cfg(feature = "BluetoothLeScanFilterInit")]
90    #[doc = "Change the `filters` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`, `BluetoothPermissionDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
96    #[wasm_bindgen(method, setter = "filters")]
97    pub fn set_filters(this: &BluetoothPermissionDescriptor, val: &[BluetoothLeScanFilterInit]);
98    #[cfg(web_sys_unstable_apis)]
99    #[doc = "Get the `optionalServices` field of this object."]
100    #[doc = ""]
101    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
102    #[doc = ""]
103    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
104    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
105    #[wasm_bindgen(method, getter = "optionalServices")]
106    pub fn get_optional_services(this: &BluetoothPermissionDescriptor) -> Option<::js_sys::Array>;
107    #[cfg(web_sys_unstable_apis)]
108    #[doc = "Change the `optionalServices` field of this object."]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
111    #[doc = ""]
112    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
113    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
114    #[wasm_bindgen(method, setter = "optionalServices")]
115    pub fn set_optional_services(this: &BluetoothPermissionDescriptor, val: &[::js_sys::JsString]);
116    #[cfg(web_sys_unstable_apis)]
117    #[doc = "Change the `optionalServices` field of this object."]
118    #[doc = ""]
119    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
120    #[doc = ""]
121    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
122    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
123    #[wasm_bindgen(method, setter = "optionalServices")]
124    pub fn set_optional_services_u32_sequence(
125        this: &BluetoothPermissionDescriptor,
126        val: &[::js_sys::Number],
127    );
128}
129#[cfg(web_sys_unstable_apis)]
130impl BluetoothPermissionDescriptor {
131    #[cfg(feature = "PermissionName")]
132    #[doc = "Construct a new `BluetoothPermissionDescriptor`."]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
138    pub fn new(name: PermissionName) -> Self {
139        #[allow(unused_mut)]
140        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
141        ret.set_name(name);
142        ret
143    }
144    #[cfg(web_sys_unstable_apis)]
145    #[cfg(feature = "PermissionName")]
146    #[deprecated = "Use `set_name()` instead."]
147    pub fn name(&mut self, val: PermissionName) -> &mut Self {
148        self.set_name(val);
149        self
150    }
151    #[cfg(web_sys_unstable_apis)]
152    #[deprecated = "Use `set_accept_all_devices()` instead."]
153    pub fn accept_all_devices(&mut self, val: bool) -> &mut Self {
154        self.set_accept_all_devices(val);
155        self
156    }
157    #[cfg(web_sys_unstable_apis)]
158    #[deprecated = "Use `set_device_id()` instead."]
159    pub fn device_id(&mut self, val: &str) -> &mut Self {
160        self.set_device_id(val);
161        self
162    }
163    #[cfg(web_sys_unstable_apis)]
164    #[cfg(feature = "BluetoothLeScanFilterInit")]
165    #[deprecated = "Use `set_filters()` instead."]
166    pub fn filters(&mut self, val: &[BluetoothLeScanFilterInit]) -> &mut Self {
167        self.set_filters(val);
168        self
169    }
170    #[cfg(web_sys_unstable_apis)]
171    #[deprecated = "Use `set_optional_services()` instead."]
172    pub fn optional_services(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
173        self.set_optional_services(val);
174        self
175    }
176}