Skip to main content

web_sys/features/
gen_WebTransportOptions.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 = WebTransportOptions)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `WebTransportOptions` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type WebTransportOptions;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `allowPooling` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "allowPooling")]
25    pub fn get_allow_pooling(this: &WebTransportOptions) -> Option<bool>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `allowPooling` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
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    #[wasm_bindgen(method, setter = "allowPooling")]
34    pub fn set_allow_pooling(this: &WebTransportOptions, val: bool);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "WebTransportCongestionControl")]
37    #[doc = "Get the `congestionControl` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `WebTransportCongestionControl`, `WebTransportOptions`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "congestionControl")]
44    pub fn get_congestion_control(
45        this: &WebTransportOptions,
46    ) -> Option<WebTransportCongestionControl>;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "WebTransportCongestionControl")]
49    #[doc = "Change the `congestionControl` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `WebTransportCongestionControl`, `WebTransportOptions`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    #[wasm_bindgen(method, setter = "congestionControl")]
56    pub fn set_congestion_control(this: &WebTransportOptions, val: WebTransportCongestionControl);
57    #[cfg(web_sys_unstable_apis)]
58    #[doc = "Get the `requireUnreliable` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    #[wasm_bindgen(method, getter = "requireUnreliable")]
65    pub fn get_require_unreliable(this: &WebTransportOptions) -> Option<bool>;
66    #[cfg(web_sys_unstable_apis)]
67    #[doc = "Change the `requireUnreliable` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, setter = "requireUnreliable")]
74    pub fn set_require_unreliable(this: &WebTransportOptions, val: bool);
75    #[cfg(web_sys_unstable_apis)]
76    #[cfg(feature = "WebTransportHash")]
77    #[doc = "Get the `serverCertificateHashes` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`, `WebTransportOptions`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    #[wasm_bindgen(method, getter = "serverCertificateHashes")]
84    pub fn get_server_certificate_hashes(
85        this: &WebTransportOptions,
86    ) -> Option<::js_sys::Array<WebTransportHash>>;
87    #[cfg(web_sys_unstable_apis)]
88    #[cfg(feature = "WebTransportHash")]
89    #[doc = "Change the `serverCertificateHashes` field of this object."]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`, `WebTransportOptions`*"]
92    #[doc = ""]
93    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
94    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
95    #[wasm_bindgen(method, setter = "serverCertificateHashes")]
96    pub fn set_server_certificate_hashes(this: &WebTransportOptions, val: &[WebTransportHash]);
97}
98#[cfg(web_sys_unstable_apis)]
99impl WebTransportOptions {
100    #[doc = "Construct a new `WebTransportOptions`."]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
103    #[doc = ""]
104    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
105    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
106    pub fn new() -> Self {
107        #[allow(unused_mut)]
108        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
109        ret
110    }
111    #[cfg(web_sys_unstable_apis)]
112    #[deprecated = "Use `set_allow_pooling()` instead."]
113    pub fn allow_pooling(&mut self, val: bool) -> &mut Self {
114        self.set_allow_pooling(val);
115        self
116    }
117    #[cfg(web_sys_unstable_apis)]
118    #[cfg(feature = "WebTransportCongestionControl")]
119    #[deprecated = "Use `set_congestion_control()` instead."]
120    pub fn congestion_control(&mut self, val: WebTransportCongestionControl) -> &mut Self {
121        self.set_congestion_control(val);
122        self
123    }
124    #[cfg(web_sys_unstable_apis)]
125    #[deprecated = "Use `set_require_unreliable()` instead."]
126    pub fn require_unreliable(&mut self, val: bool) -> &mut Self {
127        self.set_require_unreliable(val);
128        self
129    }
130    #[cfg(web_sys_unstable_apis)]
131    #[cfg(feature = "WebTransportHash")]
132    #[deprecated = "Use `set_server_certificate_hashes()` instead."]
133    pub fn server_certificate_hashes(&mut self, val: &[WebTransportHash]) -> &mut Self {
134        self.set_server_certificate_hashes(val);
135        self
136    }
137}
138#[cfg(web_sys_unstable_apis)]
139impl Default for WebTransportOptions {
140    fn default() -> Self {
141        Self::new()
142    }
143}