web_sys/features/
gen_RtcMediaStreamStats.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 = RTCMediaStreamStats)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `RtcMediaStreamStats` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
12 pub type RtcMediaStreamStats;
13 #[doc = "Get the `id` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
16 #[wasm_bindgen(method, getter = "id")]
17 pub fn get_id(this: &RtcMediaStreamStats) -> 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: `RtcMediaStreamStats`*"]
21 #[wasm_bindgen(method, setter = "id")]
22 pub fn set_id(this: &RtcMediaStreamStats, 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: `RtcMediaStreamStats`*"]
26 #[wasm_bindgen(method, getter = "timestamp")]
27 pub fn get_timestamp(this: &RtcMediaStreamStats) -> 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: `RtcMediaStreamStats`*"]
31 #[wasm_bindgen(method, setter = "timestamp")]
32 pub fn set_timestamp(this: &RtcMediaStreamStats, 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: `RtcMediaStreamStats`, `RtcStatsType`*"]
37 #[wasm_bindgen(method, getter = "type")]
38 pub fn get_type(this: &RtcMediaStreamStats) -> 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: `RtcMediaStreamStats`, `RtcStatsType`*"]
43 #[wasm_bindgen(method, setter = "type")]
44 pub fn set_type(this: &RtcMediaStreamStats, val: RtcStatsType);
45 #[doc = "Get the `streamIdentifier` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
48 #[wasm_bindgen(method, getter = "streamIdentifier")]
49 pub fn get_stream_identifier(this: &RtcMediaStreamStats) -> Option<::alloc::string::String>;
50 #[doc = "Change the `streamIdentifier` field of this object."]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
53 #[wasm_bindgen(method, setter = "streamIdentifier")]
54 pub fn set_stream_identifier(this: &RtcMediaStreamStats, val: &str);
55 #[doc = "Get the `trackIds` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
58 #[wasm_bindgen(method, getter = "trackIds")]
59 pub fn get_track_ids(this: &RtcMediaStreamStats) -> Option<::js_sys::Array>;
60 #[doc = "Change the `trackIds` field of this object."]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
63 #[wasm_bindgen(method, setter = "trackIds")]
64 pub fn set_track_ids(this: &RtcMediaStreamStats, val: &::wasm_bindgen::JsValue);
65}
66impl RtcMediaStreamStats {
67 #[doc = "Construct a new `RtcMediaStreamStats`."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"]
70 pub fn new() -> Self {
71 #[allow(unused_mut)]
72 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
73 ret
74 }
75 #[deprecated = "Use `set_id()` instead."]
76 pub fn id(&mut self, val: &str) -> &mut Self {
77 self.set_id(val);
78 self
79 }
80 #[deprecated = "Use `set_timestamp()` instead."]
81 pub fn timestamp(&mut self, val: f64) -> &mut Self {
82 self.set_timestamp(val);
83 self
84 }
85 #[cfg(feature = "RtcStatsType")]
86 #[deprecated = "Use `set_type()` instead."]
87 pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
88 self.set_type(val);
89 self
90 }
91 #[deprecated = "Use `set_stream_identifier()` instead."]
92 pub fn stream_identifier(&mut self, val: &str) -> &mut Self {
93 self.set_stream_identifier(val);
94 self
95 }
96 #[deprecated = "Use `set_track_ids()` instead."]
97 pub fn track_ids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
98 self.set_track_ids(val);
99 self
100 }
101}
102impl Default for RtcMediaStreamStats {
103 fn default() -> Self {
104 Self::new()
105 }
106}