web_sys/features/
gen_RtcIceComponentStats.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 = RTCIceComponentStats)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcIceComponentStats` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
12    pub type RtcIceComponentStats;
13    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &RtcIceComponentStats) -> 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: `RtcIceComponentStats`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &RtcIceComponentStats, 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: `RtcIceComponentStats`*"]
26    #[wasm_bindgen(method, getter = "timestamp")]
27    pub fn get_timestamp(this: &RtcIceComponentStats) -> 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: `RtcIceComponentStats`*"]
31    #[wasm_bindgen(method, setter = "timestamp")]
32    pub fn set_timestamp(this: &RtcIceComponentStats, 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: `RtcIceComponentStats`, `RtcStatsType`*"]
37    #[wasm_bindgen(method, getter = "type")]
38    pub fn get_type(this: &RtcIceComponentStats) -> 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: `RtcIceComponentStats`, `RtcStatsType`*"]
43    #[wasm_bindgen(method, setter = "type")]
44    pub fn set_type(this: &RtcIceComponentStats, val: RtcStatsType);
45    #[doc = "Get the `activeConnection` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
48    #[wasm_bindgen(method, getter = "activeConnection")]
49    pub fn get_active_connection(this: &RtcIceComponentStats) -> Option<bool>;
50    #[doc = "Change the `activeConnection` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
53    #[wasm_bindgen(method, setter = "activeConnection")]
54    pub fn set_active_connection(this: &RtcIceComponentStats, val: bool);
55    #[doc = "Get the `bytesReceived` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
58    #[wasm_bindgen(method, getter = "bytesReceived")]
59    pub fn get_bytes_received(this: &RtcIceComponentStats) -> Option<u32>;
60    #[doc = "Change the `bytesReceived` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
63    #[wasm_bindgen(method, setter = "bytesReceived")]
64    pub fn set_bytes_received(this: &RtcIceComponentStats, val: u32);
65    #[doc = "Get the `bytesSent` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
68    #[wasm_bindgen(method, getter = "bytesSent")]
69    pub fn get_bytes_sent(this: &RtcIceComponentStats) -> Option<u32>;
70    #[doc = "Change the `bytesSent` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
73    #[wasm_bindgen(method, setter = "bytesSent")]
74    pub fn set_bytes_sent(this: &RtcIceComponentStats, val: u32);
75    #[doc = "Get the `component` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
78    #[wasm_bindgen(method, getter = "component")]
79    pub fn get_component(this: &RtcIceComponentStats) -> Option<i32>;
80    #[doc = "Change the `component` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
83    #[wasm_bindgen(method, setter = "component")]
84    pub fn set_component(this: &RtcIceComponentStats, val: i32);
85    #[doc = "Get the `transportId` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
88    #[wasm_bindgen(method, getter = "transportId")]
89    pub fn get_transport_id(this: &RtcIceComponentStats) -> Option<::alloc::string::String>;
90    #[doc = "Change the `transportId` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
93    #[wasm_bindgen(method, setter = "transportId")]
94    pub fn set_transport_id(this: &RtcIceComponentStats, val: &str);
95}
96impl RtcIceComponentStats {
97    #[doc = "Construct a new `RtcIceComponentStats`."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
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_active_connection()` instead."]
122    pub fn active_connection(&mut self, val: bool) -> &mut Self {
123        self.set_active_connection(val);
124        self
125    }
126    #[deprecated = "Use `set_bytes_received()` instead."]
127    pub fn bytes_received(&mut self, val: u32) -> &mut Self {
128        self.set_bytes_received(val);
129        self
130    }
131    #[deprecated = "Use `set_bytes_sent()` instead."]
132    pub fn bytes_sent(&mut self, val: u32) -> &mut Self {
133        self.set_bytes_sent(val);
134        self
135    }
136    #[deprecated = "Use `set_component()` instead."]
137    pub fn component(&mut self, val: i32) -> &mut Self {
138        self.set_component(val);
139        self
140    }
141    #[deprecated = "Use `set_transport_id()` instead."]
142    pub fn transport_id(&mut self, val: &str) -> &mut Self {
143        self.set_transport_id(val);
144        self
145    }
146}
147impl Default for RtcIceComponentStats {
148    fn default() -> Self {
149        Self::new()
150    }
151}