web_sys/features/
gen_RtcMediaStreamTrackStats.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 = RTCMediaStreamTrackStats)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcMediaStreamTrackStats` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
12    pub type RtcMediaStreamTrackStats;
13    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &RtcMediaStreamTrackStats) -> Option<::alloc::string::String>;
18    #[doc = "Change the `id` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &RtcMediaStreamTrackStats, val: &str);
23    #[doc = "Get the `timestamp` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
26    #[wasm_bindgen(method, getter = "timestamp")]
27    pub fn get_timestamp(this: &RtcMediaStreamTrackStats) -> Option<f64>;
28    #[doc = "Change the `timestamp` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
31    #[wasm_bindgen(method, setter = "timestamp")]
32    pub fn set_timestamp(this: &RtcMediaStreamTrackStats, val: f64);
33    #[cfg(feature = "RtcStatsType")]
34    #[doc = "Get the `type` field of this object."]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`, `RtcStatsType`*"]
37    #[wasm_bindgen(method, getter = "type")]
38    pub fn get_type(this: &RtcMediaStreamTrackStats) -> Option<RtcStatsType>;
39    #[cfg(feature = "RtcStatsType")]
40    #[doc = "Change the `type` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`, `RtcStatsType`*"]
43    #[wasm_bindgen(method, setter = "type")]
44    pub fn set_type(this: &RtcMediaStreamTrackStats, val: RtcStatsType);
45    #[doc = "Get the `audioLevel` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
48    #[wasm_bindgen(method, getter = "audioLevel")]
49    pub fn get_audio_level(this: &RtcMediaStreamTrackStats) -> Option<f64>;
50    #[doc = "Change the `audioLevel` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
53    #[wasm_bindgen(method, setter = "audioLevel")]
54    pub fn set_audio_level(this: &RtcMediaStreamTrackStats, val: f64);
55    #[doc = "Get the `echoReturnLoss` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
58    #[wasm_bindgen(method, getter = "echoReturnLoss")]
59    pub fn get_echo_return_loss(this: &RtcMediaStreamTrackStats) -> Option<f64>;
60    #[doc = "Change the `echoReturnLoss` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
63    #[wasm_bindgen(method, setter = "echoReturnLoss")]
64    pub fn set_echo_return_loss(this: &RtcMediaStreamTrackStats, val: f64);
65    #[doc = "Get the `echoReturnLossEnhancement` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
68    #[wasm_bindgen(method, getter = "echoReturnLossEnhancement")]
69    pub fn get_echo_return_loss_enhancement(this: &RtcMediaStreamTrackStats) -> Option<f64>;
70    #[doc = "Change the `echoReturnLossEnhancement` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
73    #[wasm_bindgen(method, setter = "echoReturnLossEnhancement")]
74    pub fn set_echo_return_loss_enhancement(this: &RtcMediaStreamTrackStats, val: f64);
75    #[doc = "Get the `frameHeight` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
78    #[wasm_bindgen(method, getter = "frameHeight")]
79    pub fn get_frame_height(this: &RtcMediaStreamTrackStats) -> Option<u32>;
80    #[doc = "Change the `frameHeight` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
83    #[wasm_bindgen(method, setter = "frameHeight")]
84    pub fn set_frame_height(this: &RtcMediaStreamTrackStats, val: u32);
85    #[doc = "Get the `frameWidth` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
88    #[wasm_bindgen(method, getter = "frameWidth")]
89    pub fn get_frame_width(this: &RtcMediaStreamTrackStats) -> Option<u32>;
90    #[doc = "Change the `frameWidth` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
93    #[wasm_bindgen(method, setter = "frameWidth")]
94    pub fn set_frame_width(this: &RtcMediaStreamTrackStats, val: u32);
95    #[doc = "Get the `framesCorrupted` field of this object."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
98    #[wasm_bindgen(method, getter = "framesCorrupted")]
99    pub fn get_frames_corrupted(this: &RtcMediaStreamTrackStats) -> Option<u32>;
100    #[doc = "Change the `framesCorrupted` field of this object."]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
103    #[wasm_bindgen(method, setter = "framesCorrupted")]
104    pub fn set_frames_corrupted(this: &RtcMediaStreamTrackStats, val: u32);
105    #[doc = "Get the `framesDecoded` field of this object."]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
108    #[wasm_bindgen(method, getter = "framesDecoded")]
109    pub fn get_frames_decoded(this: &RtcMediaStreamTrackStats) -> Option<u32>;
110    #[doc = "Change the `framesDecoded` field of this object."]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
113    #[wasm_bindgen(method, setter = "framesDecoded")]
114    pub fn set_frames_decoded(this: &RtcMediaStreamTrackStats, val: u32);
115    #[doc = "Get the `framesDropped` field of this object."]
116    #[doc = ""]
117    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
118    #[wasm_bindgen(method, getter = "framesDropped")]
119    pub fn get_frames_dropped(this: &RtcMediaStreamTrackStats) -> Option<u32>;
120    #[doc = "Change the `framesDropped` field of this object."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
123    #[wasm_bindgen(method, setter = "framesDropped")]
124    pub fn set_frames_dropped(this: &RtcMediaStreamTrackStats, val: u32);
125    #[doc = "Get the `framesPerSecond` field of this object."]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
128    #[wasm_bindgen(method, getter = "framesPerSecond")]
129    pub fn get_frames_per_second(this: &RtcMediaStreamTrackStats) -> Option<f64>;
130    #[doc = "Change the `framesPerSecond` field of this object."]
131    #[doc = ""]
132    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
133    #[wasm_bindgen(method, setter = "framesPerSecond")]
134    pub fn set_frames_per_second(this: &RtcMediaStreamTrackStats, val: f64);
135    #[doc = "Get the `framesReceived` field of this object."]
136    #[doc = ""]
137    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
138    #[wasm_bindgen(method, getter = "framesReceived")]
139    pub fn get_frames_received(this: &RtcMediaStreamTrackStats) -> Option<u32>;
140    #[doc = "Change the `framesReceived` field of this object."]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
143    #[wasm_bindgen(method, setter = "framesReceived")]
144    pub fn set_frames_received(this: &RtcMediaStreamTrackStats, val: u32);
145    #[doc = "Get the `framesSent` field of this object."]
146    #[doc = ""]
147    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
148    #[wasm_bindgen(method, getter = "framesSent")]
149    pub fn get_frames_sent(this: &RtcMediaStreamTrackStats) -> Option<u32>;
150    #[doc = "Change the `framesSent` field of this object."]
151    #[doc = ""]
152    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
153    #[wasm_bindgen(method, setter = "framesSent")]
154    pub fn set_frames_sent(this: &RtcMediaStreamTrackStats, val: u32);
155    #[doc = "Get the `remoteSource` field of this object."]
156    #[doc = ""]
157    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
158    #[wasm_bindgen(method, getter = "remoteSource")]
159    pub fn get_remote_source(this: &RtcMediaStreamTrackStats) -> Option<bool>;
160    #[doc = "Change the `remoteSource` field of this object."]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
163    #[wasm_bindgen(method, setter = "remoteSource")]
164    pub fn set_remote_source(this: &RtcMediaStreamTrackStats, val: bool);
165    #[doc = "Get the `ssrcIds` field of this object."]
166    #[doc = ""]
167    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
168    #[wasm_bindgen(method, getter = "ssrcIds")]
169    pub fn get_ssrc_ids(this: &RtcMediaStreamTrackStats) -> Option<::js_sys::Array>;
170    #[doc = "Change the `ssrcIds` field of this object."]
171    #[doc = ""]
172    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
173    #[wasm_bindgen(method, setter = "ssrcIds")]
174    pub fn set_ssrc_ids(this: &RtcMediaStreamTrackStats, val: &::wasm_bindgen::JsValue);
175    #[doc = "Get the `trackIdentifier` field of this object."]
176    #[doc = ""]
177    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
178    #[wasm_bindgen(method, getter = "trackIdentifier")]
179    pub fn get_track_identifier(this: &RtcMediaStreamTrackStats)
180        -> Option<::alloc::string::String>;
181    #[doc = "Change the `trackIdentifier` field of this object."]
182    #[doc = ""]
183    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
184    #[wasm_bindgen(method, setter = "trackIdentifier")]
185    pub fn set_track_identifier(this: &RtcMediaStreamTrackStats, val: &str);
186}
187impl RtcMediaStreamTrackStats {
188    #[doc = "Construct a new `RtcMediaStreamTrackStats`."]
189    #[doc = ""]
190    #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"]
191    pub fn new() -> Self {
192        #[allow(unused_mut)]
193        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
194        ret
195    }
196    #[deprecated = "Use `set_id()` instead."]
197    pub fn id(&mut self, val: &str) -> &mut Self {
198        self.set_id(val);
199        self
200    }
201    #[deprecated = "Use `set_timestamp()` instead."]
202    pub fn timestamp(&mut self, val: f64) -> &mut Self {
203        self.set_timestamp(val);
204        self
205    }
206    #[cfg(feature = "RtcStatsType")]
207    #[deprecated = "Use `set_type()` instead."]
208    pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
209        self.set_type(val);
210        self
211    }
212    #[deprecated = "Use `set_audio_level()` instead."]
213    pub fn audio_level(&mut self, val: f64) -> &mut Self {
214        self.set_audio_level(val);
215        self
216    }
217    #[deprecated = "Use `set_echo_return_loss()` instead."]
218    pub fn echo_return_loss(&mut self, val: f64) -> &mut Self {
219        self.set_echo_return_loss(val);
220        self
221    }
222    #[deprecated = "Use `set_echo_return_loss_enhancement()` instead."]
223    pub fn echo_return_loss_enhancement(&mut self, val: f64) -> &mut Self {
224        self.set_echo_return_loss_enhancement(val);
225        self
226    }
227    #[deprecated = "Use `set_frame_height()` instead."]
228    pub fn frame_height(&mut self, val: u32) -> &mut Self {
229        self.set_frame_height(val);
230        self
231    }
232    #[deprecated = "Use `set_frame_width()` instead."]
233    pub fn frame_width(&mut self, val: u32) -> &mut Self {
234        self.set_frame_width(val);
235        self
236    }
237    #[deprecated = "Use `set_frames_corrupted()` instead."]
238    pub fn frames_corrupted(&mut self, val: u32) -> &mut Self {
239        self.set_frames_corrupted(val);
240        self
241    }
242    #[deprecated = "Use `set_frames_decoded()` instead."]
243    pub fn frames_decoded(&mut self, val: u32) -> &mut Self {
244        self.set_frames_decoded(val);
245        self
246    }
247    #[deprecated = "Use `set_frames_dropped()` instead."]
248    pub fn frames_dropped(&mut self, val: u32) -> &mut Self {
249        self.set_frames_dropped(val);
250        self
251    }
252    #[deprecated = "Use `set_frames_per_second()` instead."]
253    pub fn frames_per_second(&mut self, val: f64) -> &mut Self {
254        self.set_frames_per_second(val);
255        self
256    }
257    #[deprecated = "Use `set_frames_received()` instead."]
258    pub fn frames_received(&mut self, val: u32) -> &mut Self {
259        self.set_frames_received(val);
260        self
261    }
262    #[deprecated = "Use `set_frames_sent()` instead."]
263    pub fn frames_sent(&mut self, val: u32) -> &mut Self {
264        self.set_frames_sent(val);
265        self
266    }
267    #[deprecated = "Use `set_remote_source()` instead."]
268    pub fn remote_source(&mut self, val: bool) -> &mut Self {
269        self.set_remote_source(val);
270        self
271    }
272    #[deprecated = "Use `set_ssrc_ids()` instead."]
273    pub fn ssrc_ids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
274        self.set_ssrc_ids(val);
275        self
276    }
277    #[deprecated = "Use `set_track_identifier()` instead."]
278    pub fn track_identifier(&mut self, val: &str) -> &mut Self {
279        self.set_track_identifier(val);
280        self
281    }
282}
283impl Default for RtcMediaStreamTrackStats {
284    fn default() -> Self {
285        Self::new()
286    }
287}