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 = :: js_sys :: Object , js_name = WebTransport , typescript_type = "WebTransport")]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `WebTransport` class."]
11 #[doc = ""]
12 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport)"]
13 #[doc = ""]
14 #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
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 WebTransport;
19 #[cfg(web_sys_unstable_apis)]
20 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = ready)]
21 #[doc = "Getter for the `ready` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/ready)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
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 ready(this: &WebTransport) -> ::js_sys::Promise<::js_sys::Undefined>;
30 #[cfg(web_sys_unstable_apis)]
31 #[cfg(feature = "WebTransportReliabilityMode")]
32 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = reliability)]
33 #[doc = "Getter for the `reliability` field of this object."]
34 #[doc = ""]
35 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/reliability)"]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportReliabilityMode`*"]
38 #[doc = ""]
39 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
40 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
41 pub fn reliability(this: &WebTransport) -> WebTransportReliabilityMode;
42 #[cfg(web_sys_unstable_apis)]
43 #[cfg(feature = "WebTransportCongestionControl")]
44 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = congestionControl)]
45 #[doc = "Getter for the `congestionControl` field of this object."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/congestionControl)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportCongestionControl`*"]
50 #[doc = ""]
51 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 pub fn congestion_control(this: &WebTransport) -> WebTransportCongestionControl;
54 #[cfg(web_sys_unstable_apis)]
55 #[cfg(feature = "WebTransportCloseInfo")]
56 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = closed)]
57 #[doc = "Getter for the `closed` field of this object."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/closed)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportCloseInfo`*"]
62 #[doc = ""]
63 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
64 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
65 pub fn closed(this: &WebTransport) -> ::js_sys::Promise<WebTransportCloseInfo>;
66 #[cfg(web_sys_unstable_apis)]
67 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = draining)]
68 #[doc = "Getter for the `draining` field of this object."]
69 #[doc = ""]
70 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/draining)"]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
73 #[doc = ""]
74 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
75 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
76 pub fn draining(this: &WebTransport) -> ::js_sys::Promise<::js_sys::Undefined>;
77 #[cfg(web_sys_unstable_apis)]
78 #[cfg(feature = "WebTransportDatagramDuplexStream")]
79 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = datagrams)]
80 #[doc = "Getter for the `datagrams` field of this object."]
81 #[doc = ""]
82 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/datagrams)"]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportDatagramDuplexStream`*"]
85 #[doc = ""]
86 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
87 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
88 pub fn datagrams(this: &WebTransport) -> WebTransportDatagramDuplexStream;
89 #[cfg(web_sys_unstable_apis)]
90 #[cfg(feature = "ReadableStream")]
91 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = incomingBidirectionalStreams)]
92 #[doc = "Getter for the `incomingBidirectionalStreams` field of this object."]
93 #[doc = ""]
94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/incomingBidirectionalStreams)"]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransport`*"]
97 #[doc = ""]
98 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
99 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
100 pub fn incoming_bidirectional_streams(this: &WebTransport) -> ReadableStream;
101 #[cfg(web_sys_unstable_apis)]
102 #[cfg(feature = "ReadableStream")]
103 # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = incomingUnidirectionalStreams)]
104 #[doc = "Getter for the `incomingUnidirectionalStreams` field of this object."]
105 #[doc = ""]
106 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/incomingUnidirectionalStreams)"]
107 #[doc = ""]
108 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransport`*"]
109 #[doc = ""]
110 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
111 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
112 pub fn incoming_unidirectional_streams(this: &WebTransport) -> ReadableStream;
113 #[cfg(web_sys_unstable_apis)]
114 #[wasm_bindgen(catch, constructor, js_class = "WebTransport")]
115 #[doc = "The `new WebTransport(..)` constructor, creating a new instance of `WebTransport`."]
116 #[doc = ""]
117 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/WebTransport)"]
118 #[doc = ""]
119 #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
120 #[doc = ""]
121 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
122 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
123 pub fn new(url: &str) -> Result<WebTransport, JsValue>;
124 #[cfg(web_sys_unstable_apis)]
125 #[cfg(feature = "WebTransportOptions")]
126 #[wasm_bindgen(catch, constructor, js_class = "WebTransport")]
127 #[doc = "The `new WebTransport(..)` constructor, creating a new instance of `WebTransport`."]
128 #[doc = ""]
129 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/WebTransport)"]
130 #[doc = ""]
131 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportOptions`*"]
132 #[doc = ""]
133 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
134 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
135 pub fn new_with_options(
136 url: &str,
137 options: &WebTransportOptions,
138 ) -> Result<WebTransport, JsValue>;
139 #[cfg(web_sys_unstable_apis)]
140 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = close)]
141 #[doc = "The `close()` method."]
142 #[doc = ""]
143 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/close)"]
144 #[doc = ""]
145 #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
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 close(this: &WebTransport);
150 #[cfg(web_sys_unstable_apis)]
151 #[cfg(feature = "WebTransportCloseInfo")]
152 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = close)]
153 #[doc = "The `close()` method."]
154 #[doc = ""]
155 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/close)"]
156 #[doc = ""]
157 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportCloseInfo`*"]
158 #[doc = ""]
159 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
160 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
161 pub fn close_with_close_info(this: &WebTransport, close_info: &WebTransportCloseInfo);
162 #[cfg(web_sys_unstable_apis)]
163 #[cfg(feature = "WebTransportBidirectionalStream")]
164 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createBidirectionalStream)]
165 #[doc = "The `createBidirectionalStream()` method."]
166 #[doc = ""]
167 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createBidirectionalStream)"]
168 #[doc = ""]
169 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportBidirectionalStream`*"]
170 #[doc = ""]
171 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
172 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
173 pub fn create_bidirectional_stream(
174 this: &WebTransport,
175 ) -> ::js_sys::Promise<WebTransportBidirectionalStream>;
176 #[cfg(web_sys_unstable_apis)]
177 #[cfg(all(
178 feature = "WebTransportBidirectionalStream",
179 feature = "WebTransportSendStreamOptions",
180 ))]
181 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createBidirectionalStream)]
182 #[doc = "The `createBidirectionalStream()` method."]
183 #[doc = ""]
184 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createBidirectionalStream)"]
185 #[doc = ""]
186 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportBidirectionalStream`, `WebTransportSendStreamOptions`*"]
187 #[doc = ""]
188 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
189 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
190 pub fn create_bidirectional_stream_with_options(
191 this: &WebTransport,
192 options: &WebTransportSendStreamOptions,
193 ) -> ::js_sys::Promise<WebTransportBidirectionalStream>;
194 #[cfg(web_sys_unstable_apis)]
195 #[cfg(feature = "WebTransportSendStream")]
196 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createUnidirectionalStream)]
197 #[doc = "The `createUnidirectionalStream()` method."]
198 #[doc = ""]
199 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream)"]
200 #[doc = ""]
201 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportSendStream`*"]
202 #[doc = ""]
203 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
204 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
205 pub fn create_unidirectional_stream(
206 this: &WebTransport,
207 ) -> ::js_sys::Promise<WebTransportSendStream>;
208 #[cfg(web_sys_unstable_apis)]
209 #[cfg(all(
210 feature = "WebTransportSendStream",
211 feature = "WebTransportSendStreamOptions",
212 ))]
213 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createUnidirectionalStream)]
214 #[doc = "The `createUnidirectionalStream()` method."]
215 #[doc = ""]
216 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream)"]
217 #[doc = ""]
218 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportSendStream`, `WebTransportSendStreamOptions`*"]
219 #[doc = ""]
220 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
221 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
222 pub fn create_unidirectional_stream_with_options(
223 this: &WebTransport,
224 options: &WebTransportSendStreamOptions,
225 ) -> ::js_sys::Promise<WebTransportSendStream>;
226 #[cfg(web_sys_unstable_apis)]
227 #[cfg(feature = "WebTransportStats")]
228 # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = getStats)]
229 #[doc = "The `getStats()` method."]
230 #[doc = ""]
231 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/getStats)"]
232 #[doc = ""]
233 #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportStats`*"]
234 #[doc = ""]
235 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
236 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
237 pub fn get_stats(this: &WebTransport) -> ::js_sys::Promise<WebTransportStats>;
238}