]> git.proxmox.com Git - rustc.git/blob - vendor/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / vendor / web-sys / src / features / gen_PresentationConnectionCloseEventInit.rs
1 #![allow(unused_imports)]
2 #![allow(clippy::all)]
3 use super::*;
4 use wasm_bindgen::prelude::*;
5 #[wasm_bindgen]
6 extern "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 }
14 impl PresentationConnectionCloseEventInit {
15 #[cfg(feature = "PresentationConnectionClosedReason")]
16 #[doc = "Construct a new `PresentationConnectionCloseEventInit`."]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"]
19 pub fn new(reason: PresentationConnectionClosedReason) -> Self {
20 #[allow(unused_mut)]
21 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
22 ret.reason(reason);
23 ret
24 }
25 #[doc = "Change the `bubbles` field of this object."]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
28 pub fn bubbles(&mut self, val: bool) -> &mut Self {
29 use wasm_bindgen::JsValue;
30 let r = ::js_sys::Reflect::set(
31 self.as_ref(),
32 &JsValue::from("bubbles"),
33 &JsValue::from(val),
34 );
35 debug_assert!(
36 r.is_ok(),
37 "setting properties should never fail on our dictionary objects"
38 );
39 let _ = r;
40 self
41 }
42 #[doc = "Change the `cancelable` field of this object."]
43 #[doc = ""]
44 #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
45 pub fn cancelable(&mut self, val: bool) -> &mut Self {
46 use wasm_bindgen::JsValue;
47 let r = ::js_sys::Reflect::set(
48 self.as_ref(),
49 &JsValue::from("cancelable"),
50 &JsValue::from(val),
51 );
52 debug_assert!(
53 r.is_ok(),
54 "setting properties should never fail on our dictionary objects"
55 );
56 let _ = r;
57 self
58 }
59 #[doc = "Change the `composed` field of this object."]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
62 pub fn composed(&mut self, val: bool) -> &mut Self {
63 use wasm_bindgen::JsValue;
64 let r = ::js_sys::Reflect::set(
65 self.as_ref(),
66 &JsValue::from("composed"),
67 &JsValue::from(val),
68 );
69 debug_assert!(
70 r.is_ok(),
71 "setting properties should never fail on our dictionary objects"
72 );
73 let _ = r;
74 self
75 }
76 #[doc = "Change the `message` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"]
79 pub fn message(&mut self, val: &str) -> &mut Self {
80 use wasm_bindgen::JsValue;
81 let r = ::js_sys::Reflect::set(
82 self.as_ref(),
83 &JsValue::from("message"),
84 &JsValue::from(val),
85 );
86 debug_assert!(
87 r.is_ok(),
88 "setting properties should never fail on our dictionary objects"
89 );
90 let _ = r;
91 self
92 }
93 #[cfg(feature = "PresentationConnectionClosedReason")]
94 #[doc = "Change the `reason` field of this object."]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"]
97 pub fn reason(&mut self, val: PresentationConnectionClosedReason) -> &mut Self {
98 use wasm_bindgen::JsValue;
99 let r =
100 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val));
101 debug_assert!(
102 r.is_ok(),
103 "setting properties should never fail on our dictionary objects"
104 );
105 let _ = r;
106 self
107 }
108 }