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