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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
226 #[wasm_bindgen(method, setter = "uuids")]
227 pub fn set_uuids(this: &BluetoothAdvertisingEventInit, val: &::wasm_bindgen::JsValue);
228}
229#[cfg(web_sys_unstable_apis)]
230impl BluetoothAdvertisingEventInit {
231 #[cfg(feature = "BluetoothDevice")]
232 #[doc = "Construct a new `BluetoothAdvertisingEventInit`."]
233 #[doc = ""]
234 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
238 pub fn new(device: &BluetoothDevice) -> Self {
239 #[allow(unused_mut)]
240 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
241 ret.set_device(device);
242 ret
243 }
244 #[cfg(web_sys_unstable_apis)]
245 #[deprecated = "Use `set_bubbles()` instead."]
246 pub fn bubbles(&mut self, val: bool) -> &mut Self {
247 self.set_bubbles(val);
248 self
249 }
250 #[cfg(web_sys_unstable_apis)]
251 #[deprecated = "Use `set_cancelable()` instead."]
252 pub fn cancelable(&mut self, val: bool) -> &mut Self {
253 self.set_cancelable(val);
254 self
255 }
256 #[cfg(web_sys_unstable_apis)]
257 #[deprecated = "Use `set_composed()` instead."]
258 pub fn composed(&mut self, val: bool) -> &mut Self {
259 self.set_composed(val);
260 self
261 }
262 #[cfg(web_sys_unstable_apis)]
263 #[deprecated = "Use `set_appearance()` instead."]
264 pub fn appearance(&mut self, val: u16) -> &mut Self {
265 self.set_appearance(val);
266 self
267 }
268 #[cfg(web_sys_unstable_apis)]
269 #[cfg(feature = "BluetoothDevice")]
270 #[deprecated = "Use `set_device()` instead."]
271 pub fn device(&mut self, val: &BluetoothDevice) -> &mut Self {
272 self.set_device(val);
273 self
274 }
275 #[cfg(web_sys_unstable_apis)]
276 #[cfg(feature = "BluetoothManufacturerDataMap")]
277 #[deprecated = "Use `set_manufacturer_data()` instead."]
278 pub fn manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self {
279 self.set_manufacturer_data(val);
280 self
281 }
282 #[cfg(web_sys_unstable_apis)]
283 #[deprecated = "Use `set_name()` instead."]
284 pub fn name(&mut self, val: &str) -> &mut Self {
285 self.set_name(val);
286 self
287 }
288 #[cfg(web_sys_unstable_apis)]
289 #[deprecated = "Use `set_rssi()` instead."]
290 pub fn rssi(&mut self, val: i8) -> &mut Self {
291 self.set_rssi(val);
292 self
293 }
294 #[cfg(web_sys_unstable_apis)]
295 #[cfg(feature = "BluetoothServiceDataMap")]
296 #[deprecated = "Use `set_service_data()` instead."]
297 pub fn service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self {
298 self.set_service_data(val);
299 self
300 }
301 #[cfg(web_sys_unstable_apis)]
302 #[deprecated = "Use `set_tx_power()` instead."]
303 pub fn tx_power(&mut self, val: i8) -> &mut Self {
304 self.set_tx_power(val);
305 self
306 }
307 #[cfg(web_sys_unstable_apis)]
308 #[deprecated = "Use `set_uuids()` instead."]
309 pub fn uuids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
310 self.set_uuids(val);
311 self
312 }
313}