1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
use super::*;
/// The BluetoothCharacteristicProperties class.
/// [`BluetoothCharacteristicProperties`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct BluetoothCharacteristicProperties {
inner: Any,
}
impl FromVal for BluetoothCharacteristicProperties {
fn from_val(v: &Any) -> Self {
BluetoothCharacteristicProperties {
inner: Any::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for BluetoothCharacteristicProperties {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for BluetoothCharacteristicProperties {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for BluetoothCharacteristicProperties {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for BluetoothCharacteristicProperties {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<BluetoothCharacteristicProperties> for Any {
fn from(s: BluetoothCharacteristicProperties) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&BluetoothCharacteristicProperties> for Any {
fn from(s: &BluetoothCharacteristicProperties) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(BluetoothCharacteristicProperties);
impl BluetoothCharacteristicProperties {
/// Getter of the `broadcast` attribute.
/// [`BluetoothCharacteristicProperties.broadcast`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/broadcast)
pub fn broadcast(&self) -> bool {
self.inner.get("broadcast").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `read` attribute.
/// [`BluetoothCharacteristicProperties.read`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/read)
pub fn read(&self) -> bool {
self.inner.get("read").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `writeWithoutResponse` attribute.
/// [`BluetoothCharacteristicProperties.writeWithoutResponse`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/writeWithoutResponse)
pub fn write_without_response(&self) -> bool {
self.inner.get("writeWithoutResponse").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `write` attribute.
/// [`BluetoothCharacteristicProperties.write`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/write)
pub fn write(&self) -> bool {
self.inner.get("write").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `notify` attribute.
/// [`BluetoothCharacteristicProperties.notify`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/notify)
pub fn notify(&self) -> bool {
self.inner.get("notify").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `indicate` attribute.
/// [`BluetoothCharacteristicProperties.indicate`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/indicate)
pub fn indicate(&self) -> bool {
self.inner.get("indicate").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `authenticatedSignedWrites` attribute.
/// [`BluetoothCharacteristicProperties.authenticatedSignedWrites`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/authenticatedSignedWrites)
pub fn authenticated_signed_writes(&self) -> bool {
self.inner.get("authenticatedSignedWrites").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `reliableWrite` attribute.
/// [`BluetoothCharacteristicProperties.reliableWrite`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/reliableWrite)
pub fn reliable_write(&self) -> bool {
self.inner.get("reliableWrite").as_::<bool>()
}
}
impl BluetoothCharacteristicProperties {
/// Getter of the `writableAuxiliaries` attribute.
/// [`BluetoothCharacteristicProperties.writableAuxiliaries`](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/writableAuxiliaries)
pub fn writable_auxiliaries(&self) -> bool {
self.inner.get("writableAuxiliaries").as_::<bool>()
}
}