maxcountryman_web_sys/features/
gen_RtcTrackEventInit.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCTrackEventInit)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `RtcTrackEventInit` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"]
11 pub type RtcTrackEventInit;
12}
13impl RtcTrackEventInit {
14 #[cfg(all(
15 feature = "MediaStreamTrack",
16 feature = "RtcRtpReceiver",
17 feature = "RtcRtpTransceiver",
18 ))]
19 #[doc = "Construct a new `RtcTrackEventInit`."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcRtpReceiver`, `RtcRtpTransceiver`, `RtcTrackEventInit`*"]
22 pub fn new(
23 receiver: &RtcRtpReceiver,
24 track: &MediaStreamTrack,
25 transceiver: &RtcRtpTransceiver,
26 ) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.receiver(receiver);
30 ret.track(track);
31 ret.transceiver(transceiver);
32 ret
33 }
34 #[doc = "Change the `bubbles` field of this object."]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"]
37 pub fn bubbles(&mut self, val: bool) -> &mut Self {
38 use wasm_bindgen::JsValue;
39 let r = ::js_sys::Reflect::set(
40 self.as_ref(),
41 &JsValue::from("bubbles"),
42 &JsValue::from(val),
43 );
44 debug_assert!(
45 r.is_ok(),
46 "setting properties should never fail on our dictionary objects"
47 );
48 let _ = r;
49 self
50 }
51 #[doc = "Change the `cancelable` field of this object."]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"]
54 pub fn cancelable(&mut self, val: bool) -> &mut Self {
55 use wasm_bindgen::JsValue;
56 let r = ::js_sys::Reflect::set(
57 self.as_ref(),
58 &JsValue::from("cancelable"),
59 &JsValue::from(val),
60 );
61 debug_assert!(
62 r.is_ok(),
63 "setting properties should never fail on our dictionary objects"
64 );
65 let _ = r;
66 self
67 }
68 #[doc = "Change the `composed` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"]
71 pub fn composed(&mut self, val: bool) -> &mut Self {
72 use wasm_bindgen::JsValue;
73 let r = ::js_sys::Reflect::set(
74 self.as_ref(),
75 &JsValue::from("composed"),
76 &JsValue::from(val),
77 );
78 debug_assert!(
79 r.is_ok(),
80 "setting properties should never fail on our dictionary objects"
81 );
82 let _ = r;
83 self
84 }
85 #[cfg(feature = "RtcRtpReceiver")]
86 #[doc = "Change the `receiver` field of this object."]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcTrackEventInit`*"]
89 pub fn receiver(&mut self, val: &RtcRtpReceiver) -> &mut Self {
90 use wasm_bindgen::JsValue;
91 let r = ::js_sys::Reflect::set(
92 self.as_ref(),
93 &JsValue::from("receiver"),
94 &JsValue::from(val),
95 );
96 debug_assert!(
97 r.is_ok(),
98 "setting properties should never fail on our dictionary objects"
99 );
100 let _ = r;
101 self
102 }
103 #[doc = "Change the `streams` field of this object."]
104 #[doc = ""]
105 #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"]
106 pub fn streams(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
107 use wasm_bindgen::JsValue;
108 let r = ::js_sys::Reflect::set(
109 self.as_ref(),
110 &JsValue::from("streams"),
111 &JsValue::from(val),
112 );
113 debug_assert!(
114 r.is_ok(),
115 "setting properties should never fail on our dictionary objects"
116 );
117 let _ = r;
118 self
119 }
120 #[cfg(feature = "MediaStreamTrack")]
121 #[doc = "Change the `track` field of this object."]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcTrackEventInit`*"]
124 pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self {
125 use wasm_bindgen::JsValue;
126 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val));
127 debug_assert!(
128 r.is_ok(),
129 "setting properties should never fail on our dictionary objects"
130 );
131 let _ = r;
132 self
133 }
134 #[cfg(feature = "RtcRtpTransceiver")]
135 #[doc = "Change the `transceiver` field of this object."]
136 #[doc = ""]
137 #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`, `RtcTrackEventInit`*"]
138 pub fn transceiver(&mut self, val: &RtcRtpTransceiver) -> &mut Self {
139 use wasm_bindgen::JsValue;
140 let r = ::js_sys::Reflect::set(
141 self.as_ref(),
142 &JsValue::from("transceiver"),
143 &JsValue::from(val),
144 );
145 debug_assert!(
146 r.is_ok(),
147 "setting properties should never fail on our dictionary objects"
148 );
149 let _ = r;
150 self
151 }
152}