maxcountryman_web_sys/features/
gen_RtcIceComponentStats.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCIceComponentStats)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `RtcIceComponentStats` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
11 pub type RtcIceComponentStats;
12}
13impl RtcIceComponentStats {
14 #[doc = "Construct a new `RtcIceComponentStats`."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
17 pub fn new() -> Self {
18 #[allow(unused_mut)]
19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20 ret
21 }
22 #[doc = "Change the `id` field of this object."]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
25 pub fn id(&mut self, val: &str) -> &mut Self {
26 use wasm_bindgen::JsValue;
27 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val));
28 debug_assert!(
29 r.is_ok(),
30 "setting properties should never fail on our dictionary objects"
31 );
32 let _ = r;
33 self
34 }
35 #[doc = "Change the `timestamp` field of this object."]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
38 pub fn timestamp(&mut self, val: f64) -> &mut Self {
39 use wasm_bindgen::JsValue;
40 let r = ::js_sys::Reflect::set(
41 self.as_ref(),
42 &JsValue::from("timestamp"),
43 &JsValue::from(val),
44 );
45 debug_assert!(
46 r.is_ok(),
47 "setting properties should never fail on our dictionary objects"
48 );
49 let _ = r;
50 self
51 }
52 #[cfg(feature = "RtcStatsType")]
53 #[doc = "Change the `type` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`, `RtcStatsType`*"]
56 pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
57 use wasm_bindgen::JsValue;
58 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
59 debug_assert!(
60 r.is_ok(),
61 "setting properties should never fail on our dictionary objects"
62 );
63 let _ = r;
64 self
65 }
66 #[doc = "Change the `activeConnection` field of this object."]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
69 pub fn active_connection(&mut self, val: bool) -> &mut Self {
70 use wasm_bindgen::JsValue;
71 let r = ::js_sys::Reflect::set(
72 self.as_ref(),
73 &JsValue::from("activeConnection"),
74 &JsValue::from(val),
75 );
76 debug_assert!(
77 r.is_ok(),
78 "setting properties should never fail on our dictionary objects"
79 );
80 let _ = r;
81 self
82 }
83 #[doc = "Change the `bytesReceived` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
86 pub fn bytes_received(&mut self, val: u32) -> &mut Self {
87 use wasm_bindgen::JsValue;
88 let r = ::js_sys::Reflect::set(
89 self.as_ref(),
90 &JsValue::from("bytesReceived"),
91 &JsValue::from(val),
92 );
93 debug_assert!(
94 r.is_ok(),
95 "setting properties should never fail on our dictionary objects"
96 );
97 let _ = r;
98 self
99 }
100 #[doc = "Change the `bytesSent` field of this object."]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
103 pub fn bytes_sent(&mut self, val: u32) -> &mut Self {
104 use wasm_bindgen::JsValue;
105 let r = ::js_sys::Reflect::set(
106 self.as_ref(),
107 &JsValue::from("bytesSent"),
108 &JsValue::from(val),
109 );
110 debug_assert!(
111 r.is_ok(),
112 "setting properties should never fail on our dictionary objects"
113 );
114 let _ = r;
115 self
116 }
117 #[doc = "Change the `component` field of this object."]
118 #[doc = ""]
119 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
120 pub fn component(&mut self, val: i32) -> &mut Self {
121 use wasm_bindgen::JsValue;
122 let r = ::js_sys::Reflect::set(
123 self.as_ref(),
124 &JsValue::from("component"),
125 &JsValue::from(val),
126 );
127 debug_assert!(
128 r.is_ok(),
129 "setting properties should never fail on our dictionary objects"
130 );
131 let _ = r;
132 self
133 }
134 #[doc = "Change the `transportId` field of this object."]
135 #[doc = ""]
136 #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"]
137 pub fn transport_id(&mut self, val: &str) -> &mut Self {
138 use wasm_bindgen::JsValue;
139 let r = ::js_sys::Reflect::set(
140 self.as_ref(),
141 &JsValue::from("transportId"),
142 &JsValue::from(val),
143 );
144 debug_assert!(
145 r.is_ok(),
146 "setting properties should never fail on our dictionary objects"
147 );
148 let _ = r;
149 self
150 }
151}
152impl Default for RtcIceComponentStats {
153 fn default() -> Self {
154 Self::new()
155 }
156}