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