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