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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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    #[doc = "Get the `serverCertificateHashes` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
79    #[doc = ""]
80    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    #[wasm_bindgen(method, getter = "serverCertificateHashes")]
83    pub fn get_server_certificate_hashes(this: &WebTransportOptions) -> Option<::js_sys::Array>;
84    #[cfg(web_sys_unstable_apis)]
85    #[doc = "Change the `serverCertificateHashes` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
88    #[doc = ""]
89    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
91    #[wasm_bindgen(method, setter = "serverCertificateHashes")]
92    pub fn set_server_certificate_hashes(this: &WebTransportOptions, val: &::wasm_bindgen::JsValue);
93}
94#[cfg(web_sys_unstable_apis)]
95impl WebTransportOptions {
96    #[doc = "Construct a new `WebTransportOptions`."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"]
99    #[doc = ""]
100    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
101    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
102    pub fn new() -> Self {
103        #[allow(unused_mut)]
104        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
105        ret
106    }
107    #[cfg(web_sys_unstable_apis)]
108    #[deprecated = "Use `set_allow_pooling()` instead."]
109    pub fn allow_pooling(&mut self, val: bool) -> &mut Self {
110        self.set_allow_pooling(val);
111        self
112    }
113    #[cfg(web_sys_unstable_apis)]
114    #[cfg(feature = "WebTransportCongestionControl")]
115    #[deprecated = "Use `set_congestion_control()` instead."]
116    pub fn congestion_control(&mut self, val: WebTransportCongestionControl) -> &mut Self {
117        self.set_congestion_control(val);
118        self
119    }
120    #[cfg(web_sys_unstable_apis)]
121    #[deprecated = "Use `set_require_unreliable()` instead."]
122    pub fn require_unreliable(&mut self, val: bool) -> &mut Self {
123        self.set_require_unreliable(val);
124        self
125    }
126    #[cfg(web_sys_unstable_apis)]
127    #[deprecated = "Use `set_server_certificate_hashes()` instead."]
128    pub fn server_certificate_hashes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
129        self.set_server_certificate_hashes(val);
130        self
131    }
132}
133#[cfg(web_sys_unstable_apis)]
134impl Default for WebTransportOptions {
135    fn default() -> Self {
136        Self::new()
137    }
138}