web_sys/features/
gen_RtcTransportStats.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 = RTCTransportStats)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcTransportStats` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
12    pub type RtcTransportStats;
13    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &RtcTransportStats) -> 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: `RtcTransportStats`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &RtcTransportStats, 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: `RtcTransportStats`*"]
26    #[wasm_bindgen(method, getter = "timestamp")]
27    pub fn get_timestamp(this: &RtcTransportStats) -> 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: `RtcTransportStats`*"]
31    #[wasm_bindgen(method, setter = "timestamp")]
32    pub fn set_timestamp(this: &RtcTransportStats, 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: `RtcStatsType`, `RtcTransportStats`*"]
37    #[wasm_bindgen(method, getter = "type")]
38    pub fn get_type(this: &RtcTransportStats) -> 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: `RtcStatsType`, `RtcTransportStats`*"]
43    #[wasm_bindgen(method, setter = "type")]
44    pub fn set_type(this: &RtcTransportStats, val: RtcStatsType);
45    #[doc = "Get the `bytesReceived` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
48    #[wasm_bindgen(method, getter = "bytesReceived")]
49    pub fn get_bytes_received(this: &RtcTransportStats) -> Option<u32>;
50    #[doc = "Change the `bytesReceived` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
53    #[wasm_bindgen(method, setter = "bytesReceived")]
54    pub fn set_bytes_received(this: &RtcTransportStats, val: u32);
55    #[doc = "Get the `bytesSent` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
58    #[wasm_bindgen(method, getter = "bytesSent")]
59    pub fn get_bytes_sent(this: &RtcTransportStats) -> Option<u32>;
60    #[doc = "Change the `bytesSent` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
63    #[wasm_bindgen(method, setter = "bytesSent")]
64    pub fn set_bytes_sent(this: &RtcTransportStats, val: u32);
65}
66impl RtcTransportStats {
67    #[doc = "Construct a new `RtcTransportStats`."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"]
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_bytes_received()` instead."]
92    pub fn bytes_received(&mut self, val: u32) -> &mut Self {
93        self.set_bytes_received(val);
94        self
95    }
96    #[deprecated = "Use `set_bytes_sent()` instead."]
97    pub fn bytes_sent(&mut self, val: u32) -> &mut Self {
98        self.set_bytes_sent(val);
99        self
100    }
101}
102impl Default for RtcTransportStats {
103    fn default() -> Self {
104        Self::new()
105    }
106}