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