web_sys/features/
gen_RtcCodecStats.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 = RTCCodecStats)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcCodecStats` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
12    pub type RtcCodecStats;
13    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &RtcCodecStats) -> 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: `RtcCodecStats`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &RtcCodecStats, 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: `RtcCodecStats`*"]
26    #[wasm_bindgen(method, getter = "timestamp")]
27    pub fn get_timestamp(this: &RtcCodecStats) -> 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: `RtcCodecStats`*"]
31    #[wasm_bindgen(method, setter = "timestamp")]
32    pub fn set_timestamp(this: &RtcCodecStats, 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: `RtcCodecStats`, `RtcStatsType`*"]
37    #[wasm_bindgen(method, getter = "type")]
38    pub fn get_type(this: &RtcCodecStats) -> 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: `RtcCodecStats`, `RtcStatsType`*"]
43    #[wasm_bindgen(method, setter = "type")]
44    pub fn set_type(this: &RtcCodecStats, val: RtcStatsType);
45    #[doc = "Get the `channels` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
48    #[wasm_bindgen(method, getter = "channels")]
49    pub fn get_channels(this: &RtcCodecStats) -> Option<u32>;
50    #[doc = "Change the `channels` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
53    #[wasm_bindgen(method, setter = "channels")]
54    pub fn set_channels(this: &RtcCodecStats, val: u32);
55    #[doc = "Get the `clockRate` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
58    #[wasm_bindgen(method, getter = "clockRate")]
59    pub fn get_clock_rate(this: &RtcCodecStats) -> Option<u32>;
60    #[doc = "Change the `clockRate` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
63    #[wasm_bindgen(method, setter = "clockRate")]
64    pub fn set_clock_rate(this: &RtcCodecStats, val: u32);
65    #[doc = "Get the `codec` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
68    #[wasm_bindgen(method, getter = "codec")]
69    pub fn get_codec(this: &RtcCodecStats) -> Option<::alloc::string::String>;
70    #[doc = "Change the `codec` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
73    #[wasm_bindgen(method, setter = "codec")]
74    pub fn set_codec(this: &RtcCodecStats, val: &str);
75    #[doc = "Get the `parameters` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
78    #[wasm_bindgen(method, getter = "parameters")]
79    pub fn get_parameters(this: &RtcCodecStats) -> Option<::alloc::string::String>;
80    #[doc = "Change the `parameters` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
83    #[wasm_bindgen(method, setter = "parameters")]
84    pub fn set_parameters(this: &RtcCodecStats, val: &str);
85    #[doc = "Get the `payloadType` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
88    #[wasm_bindgen(method, getter = "payloadType")]
89    pub fn get_payload_type(this: &RtcCodecStats) -> Option<u32>;
90    #[doc = "Change the `payloadType` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
93    #[wasm_bindgen(method, setter = "payloadType")]
94    pub fn set_payload_type(this: &RtcCodecStats, val: u32);
95}
96impl RtcCodecStats {
97    #[doc = "Construct a new `RtcCodecStats`."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"]
100    pub fn new() -> Self {
101        #[allow(unused_mut)]
102        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
103        ret
104    }
105    #[deprecated = "Use `set_id()` instead."]
106    pub fn id(&mut self, val: &str) -> &mut Self {
107        self.set_id(val);
108        self
109    }
110    #[deprecated = "Use `set_timestamp()` instead."]
111    pub fn timestamp(&mut self, val: f64) -> &mut Self {
112        self.set_timestamp(val);
113        self
114    }
115    #[cfg(feature = "RtcStatsType")]
116    #[deprecated = "Use `set_type()` instead."]
117    pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
118        self.set_type(val);
119        self
120    }
121    #[deprecated = "Use `set_channels()` instead."]
122    pub fn channels(&mut self, val: u32) -> &mut Self {
123        self.set_channels(val);
124        self
125    }
126    #[deprecated = "Use `set_clock_rate()` instead."]
127    pub fn clock_rate(&mut self, val: u32) -> &mut Self {
128        self.set_clock_rate(val);
129        self
130    }
131    #[deprecated = "Use `set_codec()` instead."]
132    pub fn codec(&mut self, val: &str) -> &mut Self {
133        self.set_codec(val);
134        self
135    }
136    #[deprecated = "Use `set_parameters()` instead."]
137    pub fn parameters(&mut self, val: &str) -> &mut Self {
138        self.set_parameters(val);
139        self
140    }
141    #[deprecated = "Use `set_payload_type()` instead."]
142    pub fn payload_type(&mut self, val: u32) -> &mut Self {
143        self.set_payload_type(val);
144        self
145    }
146}
147impl Default for RtcCodecStats {
148    fn default() -> Self {
149        Self::new()
150    }
151}