web_sys/features/
gen_MessageEventInit.rs

1#![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 = MessageEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MessageEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
12    pub type MessageEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &MessageEventInit, 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: `MessageEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &MessageEventInit, 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: `MessageEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &MessageEventInit, val: bool);
43    #[doc = "Get the `data` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
46    #[wasm_bindgen(method, getter = "data")]
47    pub fn get_data(this: &MessageEventInit) -> ::wasm_bindgen::JsValue;
48    #[doc = "Change the `data` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
51    #[wasm_bindgen(method, setter = "data")]
52    pub fn set_data(this: &MessageEventInit, val: &::wasm_bindgen::JsValue);
53    #[doc = "Get the `lastEventId` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
56    #[wasm_bindgen(method, getter = "lastEventId")]
57    pub fn get_last_event_id(this: &MessageEventInit) -> Option<::alloc::string::String>;
58    #[doc = "Change the `lastEventId` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
61    #[wasm_bindgen(method, setter = "lastEventId")]
62    pub fn set_last_event_id(this: &MessageEventInit, val: &str);
63    #[doc = "Get the `origin` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
66    #[wasm_bindgen(method, getter = "origin")]
67    pub fn get_origin(this: &MessageEventInit) -> Option<::alloc::string::String>;
68    #[doc = "Change the `origin` field of this object."]
69    #[doc = ""]
70    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
71    #[wasm_bindgen(method, setter = "origin")]
72    pub fn set_origin(this: &MessageEventInit, val: &str);
73    #[doc = "Get the `ports` field of this object."]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
76    #[wasm_bindgen(method, getter = "ports")]
77    pub fn get_ports(this: &MessageEventInit) -> Option<::js_sys::Array>;
78    #[doc = "Change the `ports` field of this object."]
79    #[doc = ""]
80    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
81    #[wasm_bindgen(method, setter = "ports")]
82    pub fn set_ports(this: &MessageEventInit, val: &::wasm_bindgen::JsValue);
83    #[doc = "Get the `source` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
86    #[wasm_bindgen(method, getter = "source")]
87    pub fn get_source(this: &MessageEventInit) -> Option<::js_sys::Object>;
88    #[doc = "Change the `source` field of this object."]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
91    #[wasm_bindgen(method, setter = "source")]
92    pub fn set_source(this: &MessageEventInit, val: Option<&::js_sys::Object>);
93}
94impl MessageEventInit {
95    #[doc = "Construct a new `MessageEventInit`."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
98    pub fn new() -> Self {
99        #[allow(unused_mut)]
100        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
101        ret
102    }
103    #[deprecated = "Use `set_bubbles()` instead."]
104    pub fn bubbles(&mut self, val: bool) -> &mut Self {
105        self.set_bubbles(val);
106        self
107    }
108    #[deprecated = "Use `set_cancelable()` instead."]
109    pub fn cancelable(&mut self, val: bool) -> &mut Self {
110        self.set_cancelable(val);
111        self
112    }
113    #[deprecated = "Use `set_composed()` instead."]
114    pub fn composed(&mut self, val: bool) -> &mut Self {
115        self.set_composed(val);
116        self
117    }
118    #[deprecated = "Use `set_data()` instead."]
119    pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
120        self.set_data(val);
121        self
122    }
123    #[deprecated = "Use `set_last_event_id()` instead."]
124    pub fn last_event_id(&mut self, val: &str) -> &mut Self {
125        self.set_last_event_id(val);
126        self
127    }
128    #[deprecated = "Use `set_origin()` instead."]
129    pub fn origin(&mut self, val: &str) -> &mut Self {
130        self.set_origin(val);
131        self
132    }
133    #[deprecated = "Use `set_ports()` instead."]
134    pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
135        self.set_ports(val);
136        self
137    }
138    #[deprecated = "Use `set_source()` instead."]
139    pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
140        self.set_source(val);
141        self
142    }
143}
144impl Default for MessageEventInit {
145    fn default() -> Self {
146        Self::new()
147    }
148}