web_sys/features/
gen_AllowedBluetoothDevice.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 = AllowedBluetoothDevice)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `AllowedBluetoothDevice` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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 AllowedBluetoothDevice;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `allowedServices` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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 = "allowedServices")]
25 pub fn get_allowed_services(this: &AllowedBluetoothDevice) -> ::wasm_bindgen::JsValue;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `allowedServices` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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 = "allowedServices")]
34 pub fn set_allowed_services(this: &AllowedBluetoothDevice, val: &str);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Change the `allowedServices` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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, setter = "allowedServices")]
43 pub fn set_allowed_services_str_sequence(
44 this: &AllowedBluetoothDevice,
45 val: &[::js_sys::JsString],
46 );
47 #[cfg(web_sys_unstable_apis)]
48 #[doc = "Get the `deviceId` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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, getter = "deviceId")]
55 pub fn get_device_id(this: &AllowedBluetoothDevice) -> ::alloc::string::String;
56 #[cfg(web_sys_unstable_apis)]
57 #[doc = "Change the `deviceId` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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, setter = "deviceId")]
64 pub fn set_device_id(this: &AllowedBluetoothDevice, val: &str);
65 #[cfg(web_sys_unstable_apis)]
66 #[doc = "Get the `mayUseGATT` field of this object."]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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, getter = "mayUseGATT")]
73 pub fn get_may_use_gatt(this: &AllowedBluetoothDevice) -> bool;
74 #[cfg(web_sys_unstable_apis)]
75 #[doc = "Change the `mayUseGATT` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
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, setter = "mayUseGATT")]
82 pub fn set_may_use_gatt(this: &AllowedBluetoothDevice, val: bool);
83}
84#[cfg(web_sys_unstable_apis)]
85impl AllowedBluetoothDevice {
86 #[doc = "Construct a new `AllowedBluetoothDevice`."]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
89 #[doc = ""]
90 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
91 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
92 pub fn new(allowed_services: &str, device_id: &str, may_use_gatt: bool) -> Self {
93 #[allow(unused_mut)]
94 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
95 ret.set_allowed_services(allowed_services);
96 ret.set_device_id(device_id);
97 ret.set_may_use_gatt(may_use_gatt);
98 ret
99 }
100 #[doc = "Construct a new `AllowedBluetoothDevice`."]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"]
103 #[doc = ""]
104 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
105 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
106 pub fn new_with_str_sequence(
107 allowed_services: &[::js_sys::JsString],
108 device_id: &str,
109 may_use_gatt: bool,
110 ) -> Self {
111 #[allow(unused_mut)]
112 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
113 ret.set_allowed_services_str_sequence(allowed_services);
114 ret.set_device_id(device_id);
115 ret.set_may_use_gatt(may_use_gatt);
116 ret
117 }
118 #[cfg(web_sys_unstable_apis)]
119 #[deprecated = "Use `set_allowed_services()` instead."]
120 pub fn allowed_services(&mut self, val: &str) -> &mut Self {
121 self.set_allowed_services(val);
122 self
123 }
124 #[cfg(web_sys_unstable_apis)]
125 #[deprecated = "Use `set_device_id()` instead."]
126 pub fn device_id(&mut self, val: &str) -> &mut Self {
127 self.set_device_id(val);
128 self
129 }
130 #[cfg(web_sys_unstable_apis)]
131 #[deprecated = "Use `set_may_use_gatt()` instead."]
132 pub fn may_use_gatt(&mut self, val: bool) -> &mut Self {
133 self.set_may_use_gatt(val);
134 self
135 }
136}