web_sys/features/
gen_BluetoothDataFilterInit.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 = BluetoothDataFilterInit)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `BluetoothDataFilterInit` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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 BluetoothDataFilterInit;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `dataPrefix` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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 = "dataPrefix")]
25 pub fn get_data_prefix(this: &BluetoothDataFilterInit) -> Option<::js_sys::Object>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `dataPrefix` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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 = "dataPrefix")]
34 pub fn set_data_prefix(this: &BluetoothDataFilterInit, val: &::js_sys::Object);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Change the `dataPrefix` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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 #[doc = "# Safety"]
43 #[doc = ""]
44 #[doc = "The `val` slice must outlive any use of the dictionary on the JavaScript side. wasm-bindgen passes a raw view into wasm linear memory — if the underlying data is freed or moved before JS is done reading the field, the behaviour is undefined. Prefer the `_array` variant (takes `&Uint8Array`) for a safe alternative that copies the data."]
45 #[wasm_bindgen(method, setter = "dataPrefix")]
46 pub unsafe fn set_data_prefix_u8_slice(this: &BluetoothDataFilterInit, val: &mut [u8]);
47 #[cfg(web_sys_unstable_apis)]
48 #[doc = "Change the `dataPrefix` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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, setter = "dataPrefix")]
55 pub fn set_data_prefix_u8_array(this: &BluetoothDataFilterInit, val: &::js_sys::Uint8Array);
56 #[cfg(web_sys_unstable_apis)]
57 #[doc = "Get the `mask` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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, getter = "mask")]
64 pub fn get_mask(this: &BluetoothDataFilterInit) -> Option<::js_sys::Object>;
65 #[cfg(web_sys_unstable_apis)]
66 #[doc = "Change the `mask` field of this object."]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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, setter = "mask")]
73 pub fn set_mask(this: &BluetoothDataFilterInit, val: &::js_sys::Object);
74 #[cfg(web_sys_unstable_apis)]
75 #[doc = "Change the `mask` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
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 #[doc = "# Safety"]
82 #[doc = ""]
83 #[doc = "The `val` slice must outlive any use of the dictionary on the JavaScript side. wasm-bindgen passes a raw view into wasm linear memory — if the underlying data is freed or moved before JS is done reading the field, the behaviour is undefined. Prefer the `_array` variant (takes `&Uint8Array`) for a safe alternative that copies the data."]
84 #[wasm_bindgen(method, setter = "mask")]
85 pub unsafe fn set_mask_u8_slice(this: &BluetoothDataFilterInit, val: &mut [u8]);
86 #[cfg(web_sys_unstable_apis)]
87 #[doc = "Change the `mask` field of this object."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
90 #[doc = ""]
91 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93 #[wasm_bindgen(method, setter = "mask")]
94 pub fn set_mask_u8_array(this: &BluetoothDataFilterInit, val: &::js_sys::Uint8Array);
95}
96#[cfg(web_sys_unstable_apis)]
97impl BluetoothDataFilterInit {
98 #[doc = "Construct a new `BluetoothDataFilterInit`."]
99 #[doc = ""]
100 #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"]
101 #[doc = ""]
102 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
103 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
104 pub fn new() -> Self {
105 #[allow(unused_mut)]
106 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
107 ret
108 }
109 #[cfg(web_sys_unstable_apis)]
110 #[deprecated = "Use `set_data_prefix()` instead."]
111 pub fn data_prefix(&mut self, val: &::js_sys::Object) -> &mut Self {
112 self.set_data_prefix(val);
113 self
114 }
115 #[cfg(web_sys_unstable_apis)]
116 #[deprecated = "Use `set_mask()` instead."]
117 pub fn mask(&mut self, val: &::js_sys::Object) -> &mut Self {
118 self.set_mask(val);
119 self
120 }
121}
122#[cfg(web_sys_unstable_apis)]
123impl Default for BluetoothDataFilterInit {
124 fn default() -> Self {
125 Self::new()
126 }
127}