web_sys/features/
gen_RtcStats.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 = RTCStats)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcStats` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"]
12    pub type RtcStats;
13    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &RtcStats) -> 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: `RtcStats`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &RtcStats, 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: `RtcStats`*"]
26    #[wasm_bindgen(method, getter = "timestamp")]
27    pub fn get_timestamp(this: &RtcStats) -> 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: `RtcStats`*"]
31    #[wasm_bindgen(method, setter = "timestamp")]
32    pub fn set_timestamp(this: &RtcStats, 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: `RtcStats`, `RtcStatsType`*"]
37    #[wasm_bindgen(method, getter = "type")]
38    pub fn get_type(this: &RtcStats) -> 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: `RtcStats`, `RtcStatsType`*"]
43    #[wasm_bindgen(method, setter = "type")]
44    pub fn set_type(this: &RtcStats, val: RtcStatsType);
45}
46impl RtcStats {
47    #[doc = "Construct a new `RtcStats`."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"]
50    pub fn new() -> Self {
51        #[allow(unused_mut)]
52        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
53        ret
54    }
55    #[deprecated = "Use `set_id()` instead."]
56    pub fn id(&mut self, val: &str) -> &mut Self {
57        self.set_id(val);
58        self
59    }
60    #[deprecated = "Use `set_timestamp()` instead."]
61    pub fn timestamp(&mut self, val: f64) -> &mut Self {
62        self.set_timestamp(val);
63        self
64    }
65    #[cfg(feature = "RtcStatsType")]
66    #[deprecated = "Use `set_type()` instead."]
67    pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
68        self.set_type(val);
69        self
70    }
71}
72impl Default for RtcStats {
73    fn default() -> Self {
74        Self::new()
75    }
76}