web_sys/features/
gen_BluetoothPermissionDescriptor.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 = BluetoothPermissionDescriptor)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `BluetoothPermissionDescriptor` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
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 BluetoothPermissionDescriptor;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "PermissionName")]
19 #[doc = "Get the `name` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"]
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 #[wasm_bindgen(method, getter = "name")]
26 pub fn get_name(this: &BluetoothPermissionDescriptor) -> PermissionName;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(feature = "PermissionName")]
29 #[doc = "Change the `name` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"]
32 #[doc = ""]
33 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, setter = "name")]
36 pub fn set_name(this: &BluetoothPermissionDescriptor, val: PermissionName);
37 #[cfg(web_sys_unstable_apis)]
38 #[doc = "Get the `acceptAllDevices` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
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 #[wasm_bindgen(method, getter = "acceptAllDevices")]
45 pub fn get_accept_all_devices(this: &BluetoothPermissionDescriptor) -> Option<bool>;
46 #[cfg(web_sys_unstable_apis)]
47 #[doc = "Change the `acceptAllDevices` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
50 #[doc = ""]
51 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "acceptAllDevices")]
54 pub fn set_accept_all_devices(this: &BluetoothPermissionDescriptor, val: bool);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `deviceId` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "deviceId")]
63 pub fn get_device_id(this: &BluetoothPermissionDescriptor) -> Option<::alloc::string::String>;
64 #[cfg(web_sys_unstable_apis)]
65 #[doc = "Change the `deviceId` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
68 #[doc = ""]
69 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71 #[wasm_bindgen(method, setter = "deviceId")]
72 pub fn set_device_id(this: &BluetoothPermissionDescriptor, val: &str);
73 #[cfg(web_sys_unstable_apis)]
74 #[doc = "Get the `filters` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
77 #[doc = ""]
78 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80 #[wasm_bindgen(method, getter = "filters")]
81 pub fn get_filters(this: &BluetoothPermissionDescriptor) -> Option<::js_sys::Array>;
82 #[cfg(web_sys_unstable_apis)]
83 #[doc = "Change the `filters` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
86 #[doc = ""]
87 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
89 #[wasm_bindgen(method, setter = "filters")]
90 pub fn set_filters(this: &BluetoothPermissionDescriptor, val: &::wasm_bindgen::JsValue);
91 #[cfg(web_sys_unstable_apis)]
92 #[doc = "Get the `optionalServices` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 #[wasm_bindgen(method, getter = "optionalServices")]
99 pub fn get_optional_services(this: &BluetoothPermissionDescriptor) -> Option<::js_sys::Array>;
100 #[cfg(web_sys_unstable_apis)]
101 #[doc = "Change the `optionalServices` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"]
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 = "optionalServices")]
108 pub fn set_optional_services(
109 this: &BluetoothPermissionDescriptor,
110 val: &::wasm_bindgen::JsValue,
111 );
112}
113#[cfg(web_sys_unstable_apis)]
114impl BluetoothPermissionDescriptor {
115 #[cfg(feature = "PermissionName")]
116 #[doc = "Construct a new `BluetoothPermissionDescriptor`."]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"]
119 #[doc = ""]
120 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122 pub fn new(name: PermissionName) -> Self {
123 #[allow(unused_mut)]
124 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
125 ret.set_name(name);
126 ret
127 }
128 #[cfg(web_sys_unstable_apis)]
129 #[cfg(feature = "PermissionName")]
130 #[deprecated = "Use `set_name()` instead."]
131 pub fn name(&mut self, val: PermissionName) -> &mut Self {
132 self.set_name(val);
133 self
134 }
135 #[cfg(web_sys_unstable_apis)]
136 #[deprecated = "Use `set_accept_all_devices()` instead."]
137 pub fn accept_all_devices(&mut self, val: bool) -> &mut Self {
138 self.set_accept_all_devices(val);
139 self
140 }
141 #[cfg(web_sys_unstable_apis)]
142 #[deprecated = "Use `set_device_id()` instead."]
143 pub fn device_id(&mut self, val: &str) -> &mut Self {
144 self.set_device_id(val);
145 self
146 }
147 #[cfg(web_sys_unstable_apis)]
148 #[deprecated = "Use `set_filters()` instead."]
149 pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
150 self.set_filters(val);
151 self
152 }
153 #[cfg(web_sys_unstable_apis)]
154 #[deprecated = "Use `set_optional_services()` instead."]
155 pub fn optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
156 self.set_optional_services(val);
157 self
158 }
159}