web_sys/features/
gen_BluetoothAdvertisingEventInit.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 = BluetoothAdvertisingEventInit)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `BluetoothAdvertisingEventInit` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
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 BluetoothAdvertisingEventInit;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `bubbles` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "bubbles")]
25 pub fn get_bubbles(this: &BluetoothAdvertisingEventInit) -> Option<bool>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `bubbles` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "bubbles")]
34 pub fn set_bubbles(this: &BluetoothAdvertisingEventInit, val: bool);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `cancelable` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, getter = "cancelable")]
43 pub fn get_cancelable(this: &BluetoothAdvertisingEventInit) -> Option<bool>;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `cancelable` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "cancelable")]
52 pub fn set_cancelable(this: &BluetoothAdvertisingEventInit, val: bool);
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Get the `composed` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 #[wasm_bindgen(method, getter = "composed")]
61 pub fn get_composed(this: &BluetoothAdvertisingEventInit) -> Option<bool>;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `composed` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "composed")]
70 pub fn set_composed(this: &BluetoothAdvertisingEventInit, val: bool);
71 #[cfg(web_sys_unstable_apis)]
72 #[doc = "Get the `appearance` field of this object."]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
75 #[doc = ""]
76 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
77 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
78 #[wasm_bindgen(method, getter = "appearance")]
79 pub fn get_appearance(this: &BluetoothAdvertisingEventInit) -> Option<u16>;
80 #[cfg(web_sys_unstable_apis)]
81 #[doc = "Change the `appearance` field of this object."]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
84 #[doc = ""]
85 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
87 #[wasm_bindgen(method, setter = "appearance")]
88 pub fn set_appearance(this: &BluetoothAdvertisingEventInit, val: u16);
89 #[cfg(web_sys_unstable_apis)]
90 #[cfg(feature = "BluetoothDevice")]
91 #[doc = "Get the `device` field of this object."]
92 #[doc = ""]
93 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"]
94 #[doc = ""]
95 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
96 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
97 #[wasm_bindgen(method, getter = "device")]
98 pub fn get_device(this: &BluetoothAdvertisingEventInit) -> BluetoothDevice;
99 #[cfg(web_sys_unstable_apis)]
100 #[cfg(feature = "BluetoothDevice")]
101 #[doc = "Change the `device` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"]
104 #[doc = ""]
105 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 #[wasm_bindgen(method, setter = "device")]
108 pub fn set_device(this: &BluetoothAdvertisingEventInit, val: &BluetoothDevice);
109 #[cfg(web_sys_unstable_apis)]
110 #[cfg(feature = "BluetoothManufacturerDataMap")]
111 #[doc = "Get the `manufacturerData` field of this object."]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothManufacturerDataMap`*"]
114 #[doc = ""]
115 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
116 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
117 #[wasm_bindgen(method, getter = "manufacturerData")]
118 pub fn get_manufacturer_data(
119 this: &BluetoothAdvertisingEventInit,
120 ) -> Option<BluetoothManufacturerDataMap>;
121 #[cfg(web_sys_unstable_apis)]
122 #[cfg(feature = "BluetoothManufacturerDataMap")]
123 #[doc = "Change the `manufacturerData` field of this object."]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothManufacturerDataMap`*"]
126 #[doc = ""]
127 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
128 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
129 #[wasm_bindgen(method, setter = "manufacturerData")]
130 pub fn set_manufacturer_data(
131 this: &BluetoothAdvertisingEventInit,
132 val: &BluetoothManufacturerDataMap,
133 );
134 #[cfg(web_sys_unstable_apis)]
135 #[doc = "Get the `name` field of this object."]
136 #[doc = ""]
137 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
138 #[doc = ""]
139 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
140 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
141 #[wasm_bindgen(method, getter = "name")]
142 pub fn get_name(this: &BluetoothAdvertisingEventInit) -> Option<::alloc::string::String>;
143 #[cfg(web_sys_unstable_apis)]
144 #[doc = "Change the `name` field of this object."]
145 #[doc = ""]
146 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
147 #[doc = ""]
148 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
149 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
150 #[wasm_bindgen(method, setter = "name")]
151 pub fn set_name(this: &BluetoothAdvertisingEventInit, val: &str);
152 #[cfg(web_sys_unstable_apis)]
153 #[doc = "Get the `rssi` field of this object."]
154 #[doc = ""]
155 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
156 #[doc = ""]
157 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
158 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
159 #[wasm_bindgen(method, getter = "rssi")]
160 pub fn get_rssi(this: &BluetoothAdvertisingEventInit) -> Option<i8>;
161 #[cfg(web_sys_unstable_apis)]
162 #[doc = "Change the `rssi` field of this object."]
163 #[doc = ""]
164 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
165 #[doc = ""]
166 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
167 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
168 #[wasm_bindgen(method, setter = "rssi")]
169 pub fn set_rssi(this: &BluetoothAdvertisingEventInit, val: i8);
170 #[cfg(web_sys_unstable_apis)]
171 #[cfg(feature = "BluetoothServiceDataMap")]
172 #[doc = "Get the `serviceData` field of this object."]
173 #[doc = ""]
174 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothServiceDataMap`*"]
175 #[doc = ""]
176 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
177 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
178 #[wasm_bindgen(method, getter = "serviceData")]
179 pub fn get_service_data(
180 this: &BluetoothAdvertisingEventInit,
181 ) -> Option<BluetoothServiceDataMap>;
182 #[cfg(web_sys_unstable_apis)]
183 #[cfg(feature = "BluetoothServiceDataMap")]
184 #[doc = "Change the `serviceData` field of this object."]
185 #[doc = ""]
186 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothServiceDataMap`*"]
187 #[doc = ""]
188 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
189 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
190 #[wasm_bindgen(method, setter = "serviceData")]
191 pub fn set_service_data(this: &BluetoothAdvertisingEventInit, val: &BluetoothServiceDataMap);
192 #[cfg(web_sys_unstable_apis)]
193 #[doc = "Get the `txPower` field of this object."]
194 #[doc = ""]
195 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
196 #[doc = ""]
197 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
198 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
199 #[wasm_bindgen(method, getter = "txPower")]
200 pub fn get_tx_power(this: &BluetoothAdvertisingEventInit) -> Option<i8>;
201 #[cfg(web_sys_unstable_apis)]
202 #[doc = "Change the `txPower` field of this object."]
203 #[doc = ""]
204 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
205 #[doc = ""]
206 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
207 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
208 #[wasm_bindgen(method, setter = "txPower")]
209 pub fn set_tx_power(this: &BluetoothAdvertisingEventInit, val: i8);
210 #[cfg(web_sys_unstable_apis)]
211 #[doc = "Get the `uuids` field of this object."]
212 #[doc = ""]
213 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
214 #[doc = ""]
215 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
216 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
217 #[wasm_bindgen(method, getter = "uuids")]
218 pub fn get_uuids(this: &BluetoothAdvertisingEventInit) -> Option<::js_sys::Array>;
219 #[cfg(web_sys_unstable_apis)]
220 #[doc = "Change the `uuids` field of this object."]
221 #[doc = ""]
222 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
223 #[doc = ""]
224 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
225 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
226 #[wasm_bindgen(method, setter = "uuids")]
227 pub fn set_uuids(this: &BluetoothAdvertisingEventInit, val: &[::js_sys::JsString]);
228 #[cfg(web_sys_unstable_apis)]
229 #[doc = "Change the `uuids` field of this object."]
230 #[doc = ""]
231 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
232 #[doc = ""]
233 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
234 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
235 #[wasm_bindgen(method, setter = "uuids")]
236 pub fn set_uuids_u32_sequence(this: &BluetoothAdvertisingEventInit, val: &[::js_sys::Number]);
237}
238#[cfg(web_sys_unstable_apis)]
239impl BluetoothAdvertisingEventInit {
240 #[cfg(feature = "BluetoothDevice")]
241 #[doc = "Construct a new `BluetoothAdvertisingEventInit`."]
242 #[doc = ""]
243 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"]
244 #[doc = ""]
245 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
246 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
247 pub fn new(device: &BluetoothDevice) -> Self {
248 #[allow(unused_mut)]
249 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
250 ret.set_device(device);
251 ret
252 }
253 #[cfg(web_sys_unstable_apis)]
254 #[deprecated = "Use `set_bubbles()` instead."]
255 pub fn bubbles(&mut self, val: bool) -> &mut Self {
256 self.set_bubbles(val);
257 self
258 }
259 #[cfg(web_sys_unstable_apis)]
260 #[deprecated = "Use `set_cancelable()` instead."]
261 pub fn cancelable(&mut self, val: bool) -> &mut Self {
262 self.set_cancelable(val);
263 self
264 }
265 #[cfg(web_sys_unstable_apis)]
266 #[deprecated = "Use `set_composed()` instead."]
267 pub fn composed(&mut self, val: bool) -> &mut Self {
268 self.set_composed(val);
269 self
270 }
271 #[cfg(web_sys_unstable_apis)]
272 #[deprecated = "Use `set_appearance()` instead."]
273 pub fn appearance(&mut self, val: u16) -> &mut Self {
274 self.set_appearance(val);
275 self
276 }
277 #[cfg(web_sys_unstable_apis)]
278 #[cfg(feature = "BluetoothDevice")]
279 #[deprecated = "Use `set_device()` instead."]
280 pub fn device(&mut self, val: &BluetoothDevice) -> &mut Self {
281 self.set_device(val);
282 self
283 }
284 #[cfg(web_sys_unstable_apis)]
285 #[cfg(feature = "BluetoothManufacturerDataMap")]
286 #[deprecated = "Use `set_manufacturer_data()` instead."]
287 pub fn manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self {
288 self.set_manufacturer_data(val);
289 self
290 }
291 #[cfg(web_sys_unstable_apis)]
292 #[deprecated = "Use `set_name()` instead."]
293 pub fn name(&mut self, val: &str) -> &mut Self {
294 self.set_name(val);
295 self
296 }
297 #[cfg(web_sys_unstable_apis)]
298 #[deprecated = "Use `set_rssi()` instead."]
299 pub fn rssi(&mut self, val: i8) -> &mut Self {
300 self.set_rssi(val);
301 self
302 }
303 #[cfg(web_sys_unstable_apis)]
304 #[cfg(feature = "BluetoothServiceDataMap")]
305 #[deprecated = "Use `set_service_data()` instead."]
306 pub fn service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self {
307 self.set_service_data(val);
308 self
309 }
310 #[cfg(web_sys_unstable_apis)]
311 #[deprecated = "Use `set_tx_power()` instead."]
312 pub fn tx_power(&mut self, val: i8) -> &mut Self {
313 self.set_tx_power(val);
314 self
315 }
316 #[cfg(web_sys_unstable_apis)]
317 #[deprecated = "Use `set_uuids()` instead."]
318 pub fn uuids(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
319 self.set_uuids(val);
320 self
321 }
322}