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