maxcountryman_web_sys/features/
gen_RtcInboundRtpStreamStats.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCInboundRTPStreamStats)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `RtcInboundRtpStreamStats` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
11    pub type RtcInboundRtpStreamStats;
12}
13impl RtcInboundRtpStreamStats {
14    #[doc = "Construct a new `RtcInboundRtpStreamStats`."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
17    pub fn new() -> Self {
18        #[allow(unused_mut)]
19        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20        ret
21    }
22    #[doc = "Change the `id` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
25    pub fn id(&mut self, val: &str) -> &mut Self {
26        use wasm_bindgen::JsValue;
27        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val));
28        debug_assert!(
29            r.is_ok(),
30            "setting properties should never fail on our dictionary objects"
31        );
32        let _ = r;
33        self
34    }
35    #[doc = "Change the `timestamp` field of this object."]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
38    pub fn timestamp(&mut self, val: f64) -> &mut Self {
39        use wasm_bindgen::JsValue;
40        let r = ::js_sys::Reflect::set(
41            self.as_ref(),
42            &JsValue::from("timestamp"),
43            &JsValue::from(val),
44        );
45        debug_assert!(
46            r.is_ok(),
47            "setting properties should never fail on our dictionary objects"
48        );
49        let _ = r;
50        self
51    }
52    #[cfg(feature = "RtcStatsType")]
53    #[doc = "Change the `type` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`, `RtcStatsType`*"]
56    pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
57        use wasm_bindgen::JsValue;
58        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
59        debug_assert!(
60            r.is_ok(),
61            "setting properties should never fail on our dictionary objects"
62        );
63        let _ = r;
64        self
65    }
66    #[doc = "Change the `bitrateMean` field of this object."]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
69    pub fn bitrate_mean(&mut self, val: f64) -> &mut Self {
70        use wasm_bindgen::JsValue;
71        let r = ::js_sys::Reflect::set(
72            self.as_ref(),
73            &JsValue::from("bitrateMean"),
74            &JsValue::from(val),
75        );
76        debug_assert!(
77            r.is_ok(),
78            "setting properties should never fail on our dictionary objects"
79        );
80        let _ = r;
81        self
82    }
83    #[doc = "Change the `bitrateStdDev` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
86    pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self {
87        use wasm_bindgen::JsValue;
88        let r = ::js_sys::Reflect::set(
89            self.as_ref(),
90            &JsValue::from("bitrateStdDev"),
91            &JsValue::from(val),
92        );
93        debug_assert!(
94            r.is_ok(),
95            "setting properties should never fail on our dictionary objects"
96        );
97        let _ = r;
98        self
99    }
100    #[doc = "Change the `codecId` field of this object."]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
103    pub fn codec_id(&mut self, val: &str) -> &mut Self {
104        use wasm_bindgen::JsValue;
105        let r = ::js_sys::Reflect::set(
106            self.as_ref(),
107            &JsValue::from("codecId"),
108            &JsValue::from(val),
109        );
110        debug_assert!(
111            r.is_ok(),
112            "setting properties should never fail on our dictionary objects"
113        );
114        let _ = r;
115        self
116    }
117    #[doc = "Change the `firCount` field of this object."]
118    #[doc = ""]
119    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
120    pub fn fir_count(&mut self, val: u32) -> &mut Self {
121        use wasm_bindgen::JsValue;
122        let r = ::js_sys::Reflect::set(
123            self.as_ref(),
124            &JsValue::from("firCount"),
125            &JsValue::from(val),
126        );
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    #[doc = "Change the `framerateMean` field of this object."]
135    #[doc = ""]
136    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
137    pub fn framerate_mean(&mut self, val: f64) -> &mut Self {
138        use wasm_bindgen::JsValue;
139        let r = ::js_sys::Reflect::set(
140            self.as_ref(),
141            &JsValue::from("framerateMean"),
142            &JsValue::from(val),
143        );
144        debug_assert!(
145            r.is_ok(),
146            "setting properties should never fail on our dictionary objects"
147        );
148        let _ = r;
149        self
150    }
151    #[doc = "Change the `framerateStdDev` field of this object."]
152    #[doc = ""]
153    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
154    pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self {
155        use wasm_bindgen::JsValue;
156        let r = ::js_sys::Reflect::set(
157            self.as_ref(),
158            &JsValue::from("framerateStdDev"),
159            &JsValue::from(val),
160        );
161        debug_assert!(
162            r.is_ok(),
163            "setting properties should never fail on our dictionary objects"
164        );
165        let _ = r;
166        self
167    }
168    #[doc = "Change the `isRemote` field of this object."]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
171    pub fn is_remote(&mut self, val: bool) -> &mut Self {
172        use wasm_bindgen::JsValue;
173        let r = ::js_sys::Reflect::set(
174            self.as_ref(),
175            &JsValue::from("isRemote"),
176            &JsValue::from(val),
177        );
178        debug_assert!(
179            r.is_ok(),
180            "setting properties should never fail on our dictionary objects"
181        );
182        let _ = r;
183        self
184    }
185    #[doc = "Change the `mediaTrackId` field of this object."]
186    #[doc = ""]
187    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
188    pub fn media_track_id(&mut self, val: &str) -> &mut Self {
189        use wasm_bindgen::JsValue;
190        let r = ::js_sys::Reflect::set(
191            self.as_ref(),
192            &JsValue::from("mediaTrackId"),
193            &JsValue::from(val),
194        );
195        debug_assert!(
196            r.is_ok(),
197            "setting properties should never fail on our dictionary objects"
198        );
199        let _ = r;
200        self
201    }
202    #[doc = "Change the `mediaType` field of this object."]
203    #[doc = ""]
204    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
205    pub fn media_type(&mut self, val: &str) -> &mut Self {
206        use wasm_bindgen::JsValue;
207        let r = ::js_sys::Reflect::set(
208            self.as_ref(),
209            &JsValue::from("mediaType"),
210            &JsValue::from(val),
211        );
212        debug_assert!(
213            r.is_ok(),
214            "setting properties should never fail on our dictionary objects"
215        );
216        let _ = r;
217        self
218    }
219    #[doc = "Change the `nackCount` field of this object."]
220    #[doc = ""]
221    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
222    pub fn nack_count(&mut self, val: u32) -> &mut Self {
223        use wasm_bindgen::JsValue;
224        let r = ::js_sys::Reflect::set(
225            self.as_ref(),
226            &JsValue::from("nackCount"),
227            &JsValue::from(val),
228        );
229        debug_assert!(
230            r.is_ok(),
231            "setting properties should never fail on our dictionary objects"
232        );
233        let _ = r;
234        self
235    }
236    #[doc = "Change the `pliCount` field of this object."]
237    #[doc = ""]
238    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
239    pub fn pli_count(&mut self, val: u32) -> &mut Self {
240        use wasm_bindgen::JsValue;
241        let r = ::js_sys::Reflect::set(
242            self.as_ref(),
243            &JsValue::from("pliCount"),
244            &JsValue::from(val),
245        );
246        debug_assert!(
247            r.is_ok(),
248            "setting properties should never fail on our dictionary objects"
249        );
250        let _ = r;
251        self
252    }
253    #[doc = "Change the `remoteId` field of this object."]
254    #[doc = ""]
255    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
256    pub fn remote_id(&mut self, val: &str) -> &mut Self {
257        use wasm_bindgen::JsValue;
258        let r = ::js_sys::Reflect::set(
259            self.as_ref(),
260            &JsValue::from("remoteId"),
261            &JsValue::from(val),
262        );
263        debug_assert!(
264            r.is_ok(),
265            "setting properties should never fail on our dictionary objects"
266        );
267        let _ = r;
268        self
269    }
270    #[doc = "Change the `ssrc` field of this object."]
271    #[doc = ""]
272    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
273    pub fn ssrc(&mut self, val: &str) -> &mut Self {
274        use wasm_bindgen::JsValue;
275        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val));
276        debug_assert!(
277            r.is_ok(),
278            "setting properties should never fail on our dictionary objects"
279        );
280        let _ = r;
281        self
282    }
283    #[doc = "Change the `transportId` field of this object."]
284    #[doc = ""]
285    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
286    pub fn transport_id(&mut self, val: &str) -> &mut Self {
287        use wasm_bindgen::JsValue;
288        let r = ::js_sys::Reflect::set(
289            self.as_ref(),
290            &JsValue::from("transportId"),
291            &JsValue::from(val),
292        );
293        debug_assert!(
294            r.is_ok(),
295            "setting properties should never fail on our dictionary objects"
296        );
297        let _ = r;
298        self
299    }
300    #[doc = "Change the `bytesReceived` field of this object."]
301    #[doc = ""]
302    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
303    pub fn bytes_received(&mut self, val: f64) -> &mut Self {
304        use wasm_bindgen::JsValue;
305        let r = ::js_sys::Reflect::set(
306            self.as_ref(),
307            &JsValue::from("bytesReceived"),
308            &JsValue::from(val),
309        );
310        debug_assert!(
311            r.is_ok(),
312            "setting properties should never fail on our dictionary objects"
313        );
314        let _ = r;
315        self
316    }
317    #[doc = "Change the `discardedPackets` field of this object."]
318    #[doc = ""]
319    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
320    pub fn discarded_packets(&mut self, val: u32) -> &mut Self {
321        use wasm_bindgen::JsValue;
322        let r = ::js_sys::Reflect::set(
323            self.as_ref(),
324            &JsValue::from("discardedPackets"),
325            &JsValue::from(val),
326        );
327        debug_assert!(
328            r.is_ok(),
329            "setting properties should never fail on our dictionary objects"
330        );
331        let _ = r;
332        self
333    }
334    #[doc = "Change the `framesDecoded` field of this object."]
335    #[doc = ""]
336    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
337    pub fn frames_decoded(&mut self, val: u32) -> &mut Self {
338        use wasm_bindgen::JsValue;
339        let r = ::js_sys::Reflect::set(
340            self.as_ref(),
341            &JsValue::from("framesDecoded"),
342            &JsValue::from(val),
343        );
344        debug_assert!(
345            r.is_ok(),
346            "setting properties should never fail on our dictionary objects"
347        );
348        let _ = r;
349        self
350    }
351    #[doc = "Change the `jitter` field of this object."]
352    #[doc = ""]
353    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
354    pub fn jitter(&mut self, val: f64) -> &mut Self {
355        use wasm_bindgen::JsValue;
356        let r =
357            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("jitter"), &JsValue::from(val));
358        debug_assert!(
359            r.is_ok(),
360            "setting properties should never fail on our dictionary objects"
361        );
362        let _ = r;
363        self
364    }
365    #[doc = "Change the `packetsLost` field of this object."]
366    #[doc = ""]
367    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
368    pub fn packets_lost(&mut self, val: u32) -> &mut Self {
369        use wasm_bindgen::JsValue;
370        let r = ::js_sys::Reflect::set(
371            self.as_ref(),
372            &JsValue::from("packetsLost"),
373            &JsValue::from(val),
374        );
375        debug_assert!(
376            r.is_ok(),
377            "setting properties should never fail on our dictionary objects"
378        );
379        let _ = r;
380        self
381    }
382    #[doc = "Change the `packetsReceived` field of this object."]
383    #[doc = ""]
384    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
385    pub fn packets_received(&mut self, val: u32) -> &mut Self {
386        use wasm_bindgen::JsValue;
387        let r = ::js_sys::Reflect::set(
388            self.as_ref(),
389            &JsValue::from("packetsReceived"),
390            &JsValue::from(val),
391        );
392        debug_assert!(
393            r.is_ok(),
394            "setting properties should never fail on our dictionary objects"
395        );
396        let _ = r;
397        self
398    }
399    #[doc = "Change the `roundTripTime` field of this object."]
400    #[doc = ""]
401    #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"]
402    pub fn round_trip_time(&mut self, val: i32) -> &mut Self {
403        use wasm_bindgen::JsValue;
404        let r = ::js_sys::Reflect::set(
405            self.as_ref(),
406            &JsValue::from("roundTripTime"),
407            &JsValue::from(val),
408        );
409        debug_assert!(
410            r.is_ok(),
411            "setting properties should never fail on our dictionary objects"
412        );
413        let _ = r;
414        self
415    }
416}
417impl Default for RtcInboundRtpStreamStats {
418    fn default() -> Self {
419        Self::new()
420    }
421}