web_sys/features/
gen_SerialPort.rs

1#![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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
97    pub fn close(this: &SerialPort) -> ::js_sys::Promise;
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
108    pub fn forget(this: &SerialPort) -> ::js_sys::Promise;
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
120    pub fn get_info(this: &SerialPort) -> SerialPortInfo;
121    #[cfg(web_sys_unstable_apis)]
122    # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = getSignals)]
123    #[doc = "The `getSignals()` method."]
124    #[doc = ""]
125    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/getSignals)"]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
128    #[doc = ""]
129    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
130    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
131    pub fn get_signals(this: &SerialPort) -> ::js_sys::Promise;
132    #[cfg(web_sys_unstable_apis)]
133    #[cfg(feature = "SerialOptions")]
134    # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = open)]
135    #[doc = "The `open()` method."]
136    #[doc = ""]
137    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/open)"]
138    #[doc = ""]
139    #[doc = "*This API requires the following crate features to be activated: `SerialOptions`, `SerialPort`*"]
140    #[doc = ""]
141    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
142    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
143    pub fn open(this: &SerialPort, options: &SerialOptions) -> ::js_sys::Promise;
144    #[cfg(web_sys_unstable_apis)]
145    # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = setSignals)]
146    #[doc = "The `setSignals()` method."]
147    #[doc = ""]
148    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/setSignals)"]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"]
151    #[doc = ""]
152    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
153    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
154    pub fn set_signals(this: &SerialPort) -> ::js_sys::Promise;
155    #[cfg(web_sys_unstable_apis)]
156    #[cfg(feature = "SerialOutputSignals")]
157    # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = setSignals)]
158    #[doc = "The `setSignals()` method."]
159    #[doc = ""]
160    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/setSignals)"]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`, `SerialPort`*"]
163    #[doc = ""]
164    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
165    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
166    pub fn set_signals_with_signals(
167        this: &SerialPort,
168        signals: &SerialOutputSignals,
169    ) -> ::js_sys::Promise;
170}