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