web_sys/features/
gen_PromiseRejectionEventInit.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 = PromiseRejectionEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PromiseRejectionEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
12    pub type PromiseRejectionEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &PromiseRejectionEventInit) -> 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: `PromiseRejectionEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &PromiseRejectionEventInit, 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: `PromiseRejectionEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &PromiseRejectionEventInit) -> 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: `PromiseRejectionEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &PromiseRejectionEventInit, 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: `PromiseRejectionEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &PromiseRejectionEventInit) -> 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: `PromiseRejectionEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &PromiseRejectionEventInit, val: bool);
43    #[doc = "Get the `promise` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
46    #[wasm_bindgen(method, getter = "promise")]
47    pub fn get_promise(this: &PromiseRejectionEventInit) -> ::js_sys::Promise;
48    #[doc = "Change the `promise` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
51    #[wasm_bindgen(method, setter = "promise")]
52    pub fn set_promise(this: &PromiseRejectionEventInit, val: &::js_sys::Promise);
53    #[doc = "Get the `reason` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
56    #[wasm_bindgen(method, getter = "reason")]
57    pub fn get_reason(this: &PromiseRejectionEventInit) -> ::wasm_bindgen::JsValue;
58    #[doc = "Change the `reason` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
61    #[wasm_bindgen(method, setter = "reason")]
62    pub fn set_reason(this: &PromiseRejectionEventInit, val: &::wasm_bindgen::JsValue);
63}
64impl PromiseRejectionEventInit {
65    #[doc = "Construct a new `PromiseRejectionEventInit`."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"]
68    pub fn new(promise: &::js_sys::Promise) -> Self {
69        #[allow(unused_mut)]
70        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
71        ret.set_promise(promise);
72        ret
73    }
74    #[deprecated = "Use `set_bubbles()` instead."]
75    pub fn bubbles(&mut self, val: bool) -> &mut Self {
76        self.set_bubbles(val);
77        self
78    }
79    #[deprecated = "Use `set_cancelable()` instead."]
80    pub fn cancelable(&mut self, val: bool) -> &mut Self {
81        self.set_cancelable(val);
82        self
83    }
84    #[deprecated = "Use `set_composed()` instead."]
85    pub fn composed(&mut self, val: bool) -> &mut Self {
86        self.set_composed(val);
87        self
88    }
89    #[deprecated = "Use `set_promise()` instead."]
90    pub fn promise(&mut self, val: &::js_sys::Promise) -> &mut Self {
91        self.set_promise(val);
92        self
93    }
94    #[deprecated = "Use `set_reason()` instead."]
95    pub fn reason(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
96        self.set_reason(val);
97        self
98    }
99}