web_sys/features/
gen_WebTransportErrorOptions.rs1#![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 = WebTransportErrorOptions)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `WebTransportErrorOptions` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"]
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 WebTransportErrorOptions;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "WebTransportErrorSource")]
19 #[doc = "Get the `source` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`, `WebTransportErrorSource`*"]
22 #[doc = ""]
23 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25 #[wasm_bindgen(method, getter = "source")]
26 pub fn get_source(this: &WebTransportErrorOptions) -> Option<WebTransportErrorSource>;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(feature = "WebTransportErrorSource")]
29 #[doc = "Change the `source` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`, `WebTransportErrorSource`*"]
32 #[doc = ""]
33 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, setter = "source")]
36 pub fn set_source(this: &WebTransportErrorOptions, val: WebTransportErrorSource);
37 #[cfg(web_sys_unstable_apis)]
38 #[doc = "Get the `streamErrorCode` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"]
41 #[doc = ""]
42 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 #[wasm_bindgen(method, getter = "streamErrorCode")]
45 pub fn get_stream_error_code(this: &WebTransportErrorOptions) -> Option<u8>;
46 #[cfg(web_sys_unstable_apis)]
47 #[doc = "Change the `streamErrorCode` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"]
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 #[wasm_bindgen(method, setter = "streamErrorCode")]
54 pub fn set_stream_error_code(this: &WebTransportErrorOptions, val: Option<u8>);
55}
56#[cfg(web_sys_unstable_apis)]
57impl WebTransportErrorOptions {
58 #[doc = "Construct a new `WebTransportErrorOptions`."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"]
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 new() -> Self {
65 #[allow(unused_mut)]
66 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
67 ret
68 }
69 #[cfg(web_sys_unstable_apis)]
70 #[cfg(feature = "WebTransportErrorSource")]
71 #[deprecated = "Use `set_source()` instead."]
72 pub fn source(&mut self, val: WebTransportErrorSource) -> &mut Self {
73 self.set_source(val);
74 self
75 }
76 #[cfg(web_sys_unstable_apis)]
77 #[deprecated = "Use `set_stream_error_code()` instead."]
78 pub fn stream_error_code(&mut self, val: Option<u8>) -> &mut Self {
79 self.set_stream_error_code(val);
80 self
81 }
82}
83#[cfg(web_sys_unstable_apis)]
84impl Default for WebTransportErrorOptions {
85 fn default() -> Self {
86 Self::new()
87 }
88}