web_sys/features/
gen_SerialPort.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(
9 extends = "EventTarget",
10 extends = "::js_sys::Object",
11 js_name = "SerialPort",
12 typescript_type = "SerialPort"
13 )]
14 #[derive(Debug, Clone, PartialEq, Eq)]
15 #[doc = "The `SerialPort` class."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
20 #[doc = ""]
21 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
22 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
23 pub type SerialPort;
24 #[cfg(web_sys_unstable_apis)]
25 #[wasm_bindgen(method, getter, js_class = "SerialPort", js_name = "onconnect")]
26 #[doc = "Getter for the `onconnect` field of this object."]
27 #[doc = ""]
28 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/onconnect)"]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
31 #[doc = ""]
32 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
33 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
34 pub fn onconnect(this: &SerialPort) -> Option<::js_sys::Function>;
35 #[cfg(web_sys_unstable_apis)]
36 #[wasm_bindgen(method, setter, js_class = "SerialPort", js_name = "onconnect")]
37 #[doc = "Setter for the `onconnect` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/onconnect)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
42 #[doc = ""]
43 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45 pub fn set_onconnect(this: &SerialPort, value: Option<&::js_sys::Function>);
46 #[cfg(web_sys_unstable_apis)]
47 #[wasm_bindgen(method, getter, js_class = "SerialPort", js_name = "ondisconnect")]
48 #[doc = "Getter for the `ondisconnect` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/ondisconnect)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
53 #[doc = ""]
54 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
56 pub fn ondisconnect(this: &SerialPort) -> Option<::js_sys::Function>;
57 #[cfg(web_sys_unstable_apis)]
58 #[wasm_bindgen(method, setter, js_class = "SerialPort", js_name = "ondisconnect")]
59 #[doc = "Setter for the `ondisconnect` field of this object."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/ondisconnect)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
64 #[doc = ""]
65 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
67 pub fn set_ondisconnect(this: &SerialPort, value: Option<&::js_sys::Function>);
68 #[cfg(web_sys_unstable_apis)]
69 #[cfg(feature = "ReadableStream")]
70 #[wasm_bindgen(method, getter, js_class = "SerialPort", js_name = "readable")]
71 #[doc = "Getter for the `readable` field of this object."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/readable)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `SerialPort`*"]
76 #[doc = ""]
77 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
79 pub fn readable(this: &SerialPort) -> ReadableStream;
80 #[cfg(web_sys_unstable_apis)]
81 #[cfg(feature = "WritableStream")]
82 #[wasm_bindgen(method, getter, js_class = "SerialPort", js_name = "writable")]
83 #[doc = "Getter for the `writable` field of this object."]
84 #[doc = ""]
85 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/writable)"]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `SerialPort`, `WritableStream`*"]
88 #[doc = ""]
89 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
91 pub fn writable(this: &SerialPort) -> WritableStream;
92 #[cfg(web_sys_unstable_apis)]
93 #[wasm_bindgen(method, js_class = "SerialPort")]
94 #[doc = "The `close()` method."]
95 #[doc = ""]
96 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/close)"]
97 #[doc = ""]
98 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
99 #[doc = ""]
100 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
101 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
102 pub fn close(this: &SerialPort) -> ::js_sys::Promise<::js_sys::Undefined>;
103 #[cfg(web_sys_unstable_apis)]
104 #[wasm_bindgen(method, js_class = "SerialPort")]
105 #[doc = "The `forget()` method."]
106 #[doc = ""]
107 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/forget)"]
108 #[doc = ""]
109 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
110 #[doc = ""]
111 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
112 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
113 pub fn forget(this: &SerialPort) -> ::js_sys::Promise<::js_sys::Undefined>;
114 #[cfg(web_sys_unstable_apis)]
115 #[cfg(feature = "SerialPortInfo")]
116 #[wasm_bindgen(method, js_class = "SerialPort", js_name = "getInfo")]
117 #[doc = "The `getInfo()` method."]
118 #[doc = ""]
119 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/getInfo)"]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `SerialPort`, `SerialPortInfo`*"]
122 #[doc = ""]
123 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
125 pub fn get_info(this: &SerialPort) -> SerialPortInfo;
126 #[cfg(web_sys_unstable_apis)]
127 #[cfg(feature = "SerialInputSignals")]
128 #[wasm_bindgen(method, js_class = "SerialPort", js_name = "getSignals")]
129 #[doc = "The `getSignals()` method."]
130 #[doc = ""]
131 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/getSignals)"]
132 #[doc = ""]
133 #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`, `SerialPort`*"]
134 #[doc = ""]
135 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
136 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
137 pub fn get_signals(this: &SerialPort) -> ::js_sys::Promise<SerialInputSignals>;
138 #[cfg(web_sys_unstable_apis)]
139 #[cfg(feature = "SerialOptions")]
140 #[wasm_bindgen(method, js_class = "SerialPort")]
141 #[doc = "The `open()` method."]
142 #[doc = ""]
143 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/open)"]
144 #[doc = ""]
145 #[doc = "*This API requires the following crate features to be activated: `SerialOptions`, `SerialPort`*"]
146 #[doc = ""]
147 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
148 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
149 pub fn open(
150 this: &SerialPort,
151 options: &SerialOptions,
152 ) -> ::js_sys::Promise<::js_sys::Undefined>;
153 #[cfg(web_sys_unstable_apis)]
154 #[wasm_bindgen(method, js_class = "SerialPort", js_name = "setSignals")]
155 #[doc = "The `setSignals()` method."]
156 #[doc = ""]
157 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/setSignals)"]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
160 #[doc = ""]
161 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
162 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
163 pub fn set_signals(this: &SerialPort) -> ::js_sys::Promise<::js_sys::Undefined>;
164 #[cfg(web_sys_unstable_apis)]
165 #[cfg(feature = "SerialOutputSignals")]
166 #[wasm_bindgen(method, js_class = "SerialPort", js_name = "setSignals")]
167 #[doc = "The `setSignals()` method."]
168 #[doc = ""]
169 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/setSignals)"]
170 #[doc = ""]
171 #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`, `SerialPort`*"]
172 #[doc = ""]
173 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
174 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
175 pub fn set_signals_with_signals(
176 this: &SerialPort,
177 signals: &SerialOutputSignals,
178 ) -> ::js_sys::Promise<::js_sys::Undefined>;
179}