Skip to main content

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