Skip to main content

web_sys/features/
gen_PresentationConnectionCloseEventInit.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "PresentationConnectionCloseEventInit"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `PresentationConnectionCloseEventInit` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
15    pub type PresentationConnectionCloseEventInit;
16    #[doc = "Get the `bubbles` field of this object."]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
19    #[wasm_bindgen(method, getter = "bubbles")]
20    pub fn get_bubbles(this: &PresentationConnectionCloseEventInit) -> Option<bool>;
21    #[doc = "Change the `bubbles` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
24    #[wasm_bindgen(method, setter = "bubbles")]
25    pub fn set_bubbles(this: &PresentationConnectionCloseEventInit, val: bool);
26    #[doc = "Get the `cancelable` field of this object."]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
29    #[wasm_bindgen(method, getter = "cancelable")]
30    pub fn get_cancelable(this: &PresentationConnectionCloseEventInit) -> Option<bool>;
31    #[doc = "Change the `cancelable` field of this object."]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
34    #[wasm_bindgen(method, setter = "cancelable")]
35    pub fn set_cancelable(this: &PresentationConnectionCloseEventInit, val: bool);
36    #[doc = "Get the `composed` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
39    #[wasm_bindgen(method, getter = "composed")]
40    pub fn get_composed(this: &PresentationConnectionCloseEventInit) -> Option<bool>;
41    #[doc = "Change the `composed` field of this object."]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
44    #[wasm_bindgen(method, setter = "composed")]
45    pub fn set_composed(this: &PresentationConnectionCloseEventInit, val: bool);
46    #[doc = "Get the `message` field of this object."]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
49    #[wasm_bindgen(method, getter = "message")]
50    pub fn get_message(
51        this: &PresentationConnectionCloseEventInit,
52    ) -> Option<::alloc::string::String>;
53    #[doc = "Change the `message` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
56    #[wasm_bindgen(method, setter = "message")]
57    pub fn set_message(this: &PresentationConnectionCloseEventInit, val: &str);
58    #[cfg(feature = "PresentationConnectionClosedReason")]
59    #[doc = "Get the `reason` field of this object."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"]
62    #[wasm_bindgen(method, getter = "reason")]
63    pub fn get_reason(
64        this: &PresentationConnectionCloseEventInit,
65    ) -> PresentationConnectionClosedReason;
66    #[cfg(feature = "PresentationConnectionClosedReason")]
67    #[doc = "Change the `reason` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"]
70    #[wasm_bindgen(method, setter = "reason")]
71    pub fn set_reason(
72        this: &PresentationConnectionCloseEventInit,
73        val: PresentationConnectionClosedReason,
74    );
75}
76impl PresentationConnectionCloseEventInit {
77    #[cfg(feature = "PresentationConnectionClosedReason")]
78    #[doc = "Construct a new `PresentationConnectionCloseEventInit`."]
79    #[doc = ""]
80    #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"]
81    pub fn new(reason: PresentationConnectionClosedReason) -> Self {
82        #[allow(unused_mut)]
83        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
84        ret.set_reason(reason);
85        ret
86    }
87    #[deprecated = "Use `set_bubbles()` instead."]
88    pub fn bubbles(&mut self, val: bool) -> &mut Self {
89        self.set_bubbles(val);
90        self
91    }
92    #[deprecated = "Use `set_cancelable()` instead."]
93    pub fn cancelable(&mut self, val: bool) -> &mut Self {
94        self.set_cancelable(val);
95        self
96    }
97    #[deprecated = "Use `set_composed()` instead."]
98    pub fn composed(&mut self, val: bool) -> &mut Self {
99        self.set_composed(val);
100        self
101    }
102    #[deprecated = "Use `set_message()` instead."]
103    pub fn message(&mut self, val: &str) -> &mut Self {
104        self.set_message(val);
105        self
106    }
107    #[cfg(feature = "PresentationConnectionClosedReason")]
108    #[deprecated = "Use `set_reason()` instead."]
109    pub fn reason(&mut self, val: PresentationConnectionClosedReason) -> &mut Self {
110        self.set_reason(val);
111        self
112    }
113}