|
| 1 | +#![allow(unused_imports)] |
| 2 | +use super::*; |
| 3 | +use wasm_bindgen::prelude::*; |
| 4 | +#[cfg(web_sys_unstable_apis)] |
| 5 | +#[wasm_bindgen] |
| 6 | +extern "C" { |
| 7 | + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AllowedBluetoothDevice)] |
| 8 | + #[derive(Debug, Clone, PartialEq, Eq)] |
| 9 | + #[doc = "The `AllowedBluetoothDevice` dictionary."] |
| 10 | + #[doc = ""] |
| 11 | + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] |
| 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 AllowedBluetoothDevice; |
| 16 | +} |
| 17 | +#[cfg(web_sys_unstable_apis)] |
| 18 | +impl AllowedBluetoothDevice { |
| 19 | + #[doc = "Construct a new `AllowedBluetoothDevice`."] |
| 20 | + #[doc = ""] |
| 21 | + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] |
| 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 25 | + pub fn new( |
| 26 | + allowed_services: &::wasm_bindgen::JsValue, |
| 27 | + device_id: &str, |
| 28 | + may_use_gatt: bool, |
| 29 | + ) -> Self { |
| 30 | + #[allow(unused_mut)] |
| 31 | + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
| 32 | + ret.allowed_services(allowed_services); |
| 33 | + ret.device_id(device_id); |
| 34 | + ret.may_use_gatt(may_use_gatt); |
| 35 | + ret |
| 36 | + } |
| 37 | + #[cfg(web_sys_unstable_apis)] |
| 38 | + #[doc = "Change the `allowedServices` field of this object."] |
| 39 | + #[doc = ""] |
| 40 | + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] |
| 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 44 | + pub fn allowed_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { |
| 45 | + use wasm_bindgen::JsValue; |
| 46 | + let r = ::js_sys::Reflect::set( |
| 47 | + self.as_ref(), |
| 48 | + &JsValue::from("allowedServices"), |
| 49 | + &JsValue::from(val), |
| 50 | + ); |
| 51 | + debug_assert!( |
| 52 | + r.is_ok(), |
| 53 | + "setting properties should never fail on our dictionary objects" |
| 54 | + ); |
| 55 | + let _ = r; |
| 56 | + self |
| 57 | + } |
| 58 | + #[cfg(web_sys_unstable_apis)] |
| 59 | + #[doc = "Change the `deviceId` field of this object."] |
| 60 | + #[doc = ""] |
| 61 | + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] |
| 62 | + #[doc = ""] |
| 63 | + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] |
| 64 | + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 65 | + pub fn device_id(&mut self, val: &str) -> &mut Self { |
| 66 | + use wasm_bindgen::JsValue; |
| 67 | + let r = ::js_sys::Reflect::set( |
| 68 | + self.as_ref(), |
| 69 | + &JsValue::from("deviceId"), |
| 70 | + &JsValue::from(val), |
| 71 | + ); |
| 72 | + debug_assert!( |
| 73 | + r.is_ok(), |
| 74 | + "setting properties should never fail on our dictionary objects" |
| 75 | + ); |
| 76 | + let _ = r; |
| 77 | + self |
| 78 | + } |
| 79 | + #[cfg(web_sys_unstable_apis)] |
| 80 | + #[doc = "Change the `mayUseGATT` field of this object."] |
| 81 | + #[doc = ""] |
| 82 | + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] |
| 83 | + #[doc = ""] |
| 84 | + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] |
| 85 | + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 86 | + pub fn may_use_gatt(&mut self, val: bool) -> &mut Self { |
| 87 | + use wasm_bindgen::JsValue; |
| 88 | + let r = ::js_sys::Reflect::set( |
| 89 | + self.as_ref(), |
| 90 | + &JsValue::from("mayUseGATT"), |
| 91 | + &JsValue::from(val), |
| 92 | + ); |
| 93 | + debug_assert!( |
| 94 | + r.is_ok(), |
| 95 | + "setting properties should never fail on our dictionary objects" |
| 96 | + ); |
| 97 | + let _ = r; |
| 98 | + self |
| 99 | + } |
| 100 | +} |
0 commit comments