web_sys/features/
gen_WebTransport.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 = :: 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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
29    pub fn ready(this: &WebTransport) -> ::js_sys::Promise;
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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    pub fn congestion_control(this: &WebTransport) -> WebTransportCongestionControl;
54    #[cfg(web_sys_unstable_apis)]
55    # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = closed)]
56    #[doc = "Getter for the `closed` field of this object."]
57    #[doc = ""]
58    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/closed)"]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
61    #[doc = ""]
62    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    pub fn closed(this: &WebTransport) -> ::js_sys::Promise;
65    #[cfg(web_sys_unstable_apis)]
66    # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = draining)]
67    #[doc = "Getter for the `draining` field of this object."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/draining)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
72    #[doc = ""]
73    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
74    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
75    pub fn draining(this: &WebTransport) -> ::js_sys::Promise;
76    #[cfg(web_sys_unstable_apis)]
77    #[cfg(feature = "WebTransportDatagramDuplexStream")]
78    # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = datagrams)]
79    #[doc = "Getter for the `datagrams` field of this object."]
80    #[doc = ""]
81    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/datagrams)"]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportDatagramDuplexStream`*"]
84    #[doc = ""]
85    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    pub fn datagrams(this: &WebTransport) -> WebTransportDatagramDuplexStream;
88    #[cfg(web_sys_unstable_apis)]
89    #[cfg(feature = "ReadableStream")]
90    # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = incomingBidirectionalStreams)]
91    #[doc = "Getter for the `incomingBidirectionalStreams` field of this object."]
92    #[doc = ""]
93    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/incomingBidirectionalStreams)"]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransport`*"]
96    #[doc = ""]
97    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
98    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
99    pub fn incoming_bidirectional_streams(this: &WebTransport) -> ReadableStream;
100    #[cfg(web_sys_unstable_apis)]
101    #[cfg(feature = "ReadableStream")]
102    # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = incomingUnidirectionalStreams)]
103    #[doc = "Getter for the `incomingUnidirectionalStreams` field of this object."]
104    #[doc = ""]
105    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/incomingUnidirectionalStreams)"]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransport`*"]
108    #[doc = ""]
109    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
110    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
111    pub fn incoming_unidirectional_streams(this: &WebTransport) -> ReadableStream;
112    #[cfg(web_sys_unstable_apis)]
113    #[wasm_bindgen(catch, constructor, js_class = "WebTransport")]
114    #[doc = "The `new WebTransport(..)` constructor, creating a new instance of `WebTransport`."]
115    #[doc = ""]
116    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/WebTransport)"]
117    #[doc = ""]
118    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
119    #[doc = ""]
120    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122    pub fn new(url: &str) -> Result<WebTransport, JsValue>;
123    #[cfg(web_sys_unstable_apis)]
124    #[cfg(feature = "WebTransportOptions")]
125    #[wasm_bindgen(catch, constructor, js_class = "WebTransport")]
126    #[doc = "The `new WebTransport(..)` constructor, creating a new instance of `WebTransport`."]
127    #[doc = ""]
128    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/WebTransport)"]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportOptions`*"]
131    #[doc = ""]
132    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
133    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
134    pub fn new_with_options(
135        url: &str,
136        options: &WebTransportOptions,
137    ) -> Result<WebTransport, JsValue>;
138    #[cfg(web_sys_unstable_apis)]
139    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = close)]
140    #[doc = "The `close()` method."]
141    #[doc = ""]
142    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/close)"]
143    #[doc = ""]
144    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
145    #[doc = ""]
146    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
147    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
148    pub fn close(this: &WebTransport);
149    #[cfg(web_sys_unstable_apis)]
150    #[cfg(feature = "WebTransportCloseInfo")]
151    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = close)]
152    #[doc = "The `close()` method."]
153    #[doc = ""]
154    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/close)"]
155    #[doc = ""]
156    #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportCloseInfo`*"]
157    #[doc = ""]
158    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
159    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
160    pub fn close_with_close_info(this: &WebTransport, close_info: &WebTransportCloseInfo);
161    #[cfg(web_sys_unstable_apis)]
162    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createBidirectionalStream)]
163    #[doc = "The `createBidirectionalStream()` method."]
164    #[doc = ""]
165    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createBidirectionalStream)"]
166    #[doc = ""]
167    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
168    #[doc = ""]
169    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
170    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
171    pub fn create_bidirectional_stream(this: &WebTransport) -> ::js_sys::Promise;
172    #[cfg(web_sys_unstable_apis)]
173    #[cfg(feature = "WebTransportSendStreamOptions")]
174    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createBidirectionalStream)]
175    #[doc = "The `createBidirectionalStream()` method."]
176    #[doc = ""]
177    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createBidirectionalStream)"]
178    #[doc = ""]
179    #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportSendStreamOptions`*"]
180    #[doc = ""]
181    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
182    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
183    pub fn create_bidirectional_stream_with_options(
184        this: &WebTransport,
185        options: &WebTransportSendStreamOptions,
186    ) -> ::js_sys::Promise;
187    #[cfg(web_sys_unstable_apis)]
188    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createUnidirectionalStream)]
189    #[doc = "The `createUnidirectionalStream()` method."]
190    #[doc = ""]
191    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream)"]
192    #[doc = ""]
193    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
194    #[doc = ""]
195    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
196    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
197    pub fn create_unidirectional_stream(this: &WebTransport) -> ::js_sys::Promise;
198    #[cfg(web_sys_unstable_apis)]
199    #[cfg(feature = "WebTransportSendStreamOptions")]
200    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createUnidirectionalStream)]
201    #[doc = "The `createUnidirectionalStream()` method."]
202    #[doc = ""]
203    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream)"]
204    #[doc = ""]
205    #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportSendStreamOptions`*"]
206    #[doc = ""]
207    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
208    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
209    pub fn create_unidirectional_stream_with_options(
210        this: &WebTransport,
211        options: &WebTransportSendStreamOptions,
212    ) -> ::js_sys::Promise;
213    #[cfg(web_sys_unstable_apis)]
214    # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = getStats)]
215    #[doc = "The `getStats()` method."]
216    #[doc = ""]
217    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/getStats)"]
218    #[doc = ""]
219    #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"]
220    #[doc = ""]
221    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
222    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
223    pub fn get_stats(this: &WebTransport) -> ::js_sys::Promise;
224}