maxcountryman_web_sys/features/
gen_BluetoothAdvertisingEventInit.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothAdvertisingEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `BluetoothAdvertisingEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type BluetoothAdvertisingEventInit;
16}
17#[cfg(web_sys_unstable_apis)]
18impl BluetoothAdvertisingEventInit {
19 #[cfg(feature = "BluetoothDevice")]
20 #[doc = "Construct a new `BluetoothAdvertisingEventInit`."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"]
23 #[doc = ""]
24 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
26 pub fn new(device: &BluetoothDevice) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.device(device);
30 ret
31 }
32 #[cfg(web_sys_unstable_apis)]
33 #[doc = "Change the `bubbles` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
36 #[doc = ""]
37 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
39 pub fn bubbles(&mut self, val: bool) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(
42 self.as_ref(),
43 &JsValue::from("bubbles"),
44 &JsValue::from(val),
45 );
46 debug_assert!(
47 r.is_ok(),
48 "setting properties should never fail on our dictionary objects"
49 );
50 let _ = r;
51 self
52 }
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Change the `cancelable` 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 pub fn cancelable(&mut self, val: bool) -> &mut Self {
61 use wasm_bindgen::JsValue;
62 let r = ::js_sys::Reflect::set(
63 self.as_ref(),
64 &JsValue::from("cancelable"),
65 &JsValue::from(val),
66 );
67 debug_assert!(
68 r.is_ok(),
69 "setting properties should never fail on our dictionary objects"
70 );
71 let _ = r;
72 self
73 }
74 #[cfg(web_sys_unstable_apis)]
75 #[doc = "Change the `composed` 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
81 pub fn composed(&mut self, val: bool) -> &mut Self {
82 use wasm_bindgen::JsValue;
83 let r = ::js_sys::Reflect::set(
84 self.as_ref(),
85 &JsValue::from("composed"),
86 &JsValue::from(val),
87 );
88 debug_assert!(
89 r.is_ok(),
90 "setting properties should never fail on our dictionary objects"
91 );
92 let _ = r;
93 self
94 }
95 #[cfg(web_sys_unstable_apis)]
96 #[doc = "Change the `appearance` field of this object."]
97 #[doc = ""]
98 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
102 pub fn appearance(&mut self, val: u16) -> &mut Self {
103 use wasm_bindgen::JsValue;
104 let r = ::js_sys::Reflect::set(
105 self.as_ref(),
106 &JsValue::from("appearance"),
107 &JsValue::from(val),
108 );
109 debug_assert!(
110 r.is_ok(),
111 "setting properties should never fail on our dictionary objects"
112 );
113 let _ = r;
114 self
115 }
116 #[cfg(web_sys_unstable_apis)]
117 #[cfg(feature = "BluetoothDevice")]
118 #[doc = "Change the `device` field of this object."]
119 #[doc = ""]
120 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"]
121 #[doc = ""]
122 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
123 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
124 pub fn device(&mut self, val: &BluetoothDevice) -> &mut Self {
125 use wasm_bindgen::JsValue;
126 let r =
127 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val));
128 debug_assert!(
129 r.is_ok(),
130 "setting properties should never fail on our dictionary objects"
131 );
132 let _ = r;
133 self
134 }
135 #[cfg(web_sys_unstable_apis)]
136 #[cfg(feature = "BluetoothManufacturerDataMap")]
137 #[doc = "Change the `manufacturerData` field of this object."]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothManufacturerDataMap`*"]
140 #[doc = ""]
141 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
142 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
143 pub fn manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self {
144 use wasm_bindgen::JsValue;
145 let r = ::js_sys::Reflect::set(
146 self.as_ref(),
147 &JsValue::from("manufacturerData"),
148 &JsValue::from(val),
149 );
150 debug_assert!(
151 r.is_ok(),
152 "setting properties should never fail on our dictionary objects"
153 );
154 let _ = r;
155 self
156 }
157 #[cfg(web_sys_unstable_apis)]
158 #[doc = "Change the `name` field of this object."]
159 #[doc = ""]
160 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
161 #[doc = ""]
162 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
163 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
164 pub fn name(&mut self, val: &str) -> &mut Self {
165 use wasm_bindgen::JsValue;
166 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
167 debug_assert!(
168 r.is_ok(),
169 "setting properties should never fail on our dictionary objects"
170 );
171 let _ = r;
172 self
173 }
174 #[cfg(web_sys_unstable_apis)]
175 #[doc = "Change the `rssi` field of this object."]
176 #[doc = ""]
177 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
181 pub fn rssi(&mut self, val: i8) -> &mut Self {
182 use wasm_bindgen::JsValue;
183 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rssi"), &JsValue::from(val));
184 debug_assert!(
185 r.is_ok(),
186 "setting properties should never fail on our dictionary objects"
187 );
188 let _ = r;
189 self
190 }
191 #[cfg(web_sys_unstable_apis)]
192 #[cfg(feature = "BluetoothServiceDataMap")]
193 #[doc = "Change the `serviceData` field of this object."]
194 #[doc = ""]
195 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothServiceDataMap`*"]
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 pub fn service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self {
200 use wasm_bindgen::JsValue;
201 let r = ::js_sys::Reflect::set(
202 self.as_ref(),
203 &JsValue::from("serviceData"),
204 &JsValue::from(val),
205 );
206 debug_assert!(
207 r.is_ok(),
208 "setting properties should never fail on our dictionary objects"
209 );
210 let _ = r;
211 self
212 }
213 #[cfg(web_sys_unstable_apis)]
214 #[doc = "Change the `txPower` 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
220 pub fn tx_power(&mut self, val: i8) -> &mut Self {
221 use wasm_bindgen::JsValue;
222 let r = ::js_sys::Reflect::set(
223 self.as_ref(),
224 &JsValue::from("txPower"),
225 &JsValue::from(val),
226 );
227 debug_assert!(
228 r.is_ok(),
229 "setting properties should never fail on our dictionary objects"
230 );
231 let _ = r;
232 self
233 }
234 #[cfg(web_sys_unstable_apis)]
235 #[doc = "Change the `uuids` field of this object."]
236 #[doc = ""]
237 #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"]
238 #[doc = ""]
239 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
240 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
241 pub fn uuids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
242 use wasm_bindgen::JsValue;
243 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uuids"), &JsValue::from(val));
244 debug_assert!(
245 r.is_ok(),
246 "setting properties should never fail on our dictionary objects"
247 );
248 let _ = r;
249 self
250 }
251}