1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCIceCandidateStats)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `RtcIceCandidateStats` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
11     pub type RtcIceCandidateStats;
12 }
13 impl RtcIceCandidateStats {
14     #[doc = "Construct a new `RtcIceCandidateStats`."]
15     #[doc = ""]
16     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
new() -> Self17     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: `RtcIceCandidateStats`*"]
id(&mut self, val: &str) -> &mut Self25     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: `RtcIceCandidateStats`*"]
timestamp(&mut self, val: f64) -> &mut Self38     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: `RtcIceCandidateStats`, `RtcStatsType`*"]
type_(&mut self, val: RtcStatsType) -> &mut Self56     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 `candidateId` field of this object."]
67     #[doc = ""]
68     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
candidate_id(&mut self, val: &str) -> &mut Self69     pub fn candidate_id(&mut self, val: &str) -> &mut Self {
70         use wasm_bindgen::JsValue;
71         let r = ::js_sys::Reflect::set(
72             self.as_ref(),
73             &JsValue::from("candidateId"),
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     #[cfg(feature = "RtcStatsIceCandidateType")]
84     #[doc = "Change the `candidateType` field of this object."]
85     #[doc = ""]
86     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"]
candidate_type(&mut self, val: RtcStatsIceCandidateType) -> &mut Self87     pub fn candidate_type(&mut self, val: RtcStatsIceCandidateType) -> &mut Self {
88         use wasm_bindgen::JsValue;
89         let r = ::js_sys::Reflect::set(
90             self.as_ref(),
91             &JsValue::from("candidateType"),
92             &JsValue::from(val),
93         );
94         debug_assert!(
95             r.is_ok(),
96             "setting properties should never fail on our dictionary objects"
97         );
98         let _ = r;
99         self
100     }
101     #[doc = "Change the `componentId` field of this object."]
102     #[doc = ""]
103     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
component_id(&mut self, val: &str) -> &mut Self104     pub fn component_id(&mut self, val: &str) -> &mut Self {
105         use wasm_bindgen::JsValue;
106         let r = ::js_sys::Reflect::set(
107             self.as_ref(),
108             &JsValue::from("componentId"),
109             &JsValue::from(val),
110         );
111         debug_assert!(
112             r.is_ok(),
113             "setting properties should never fail on our dictionary objects"
114         );
115         let _ = r;
116         self
117     }
118     #[doc = "Change the `ipAddress` field of this object."]
119     #[doc = ""]
120     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
ip_address(&mut self, val: &str) -> &mut Self121     pub fn ip_address(&mut self, val: &str) -> &mut Self {
122         use wasm_bindgen::JsValue;
123         let r = ::js_sys::Reflect::set(
124             self.as_ref(),
125             &JsValue::from("ipAddress"),
126             &JsValue::from(val),
127         );
128         debug_assert!(
129             r.is_ok(),
130             "setting properties should never fail on our dictionary objects"
131         );
132         let _ = r;
133         self
134     }
135     #[doc = "Change the `portNumber` field of this object."]
136     #[doc = ""]
137     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
port_number(&mut self, val: i32) -> &mut Self138     pub fn port_number(&mut self, val: i32) -> &mut Self {
139         use wasm_bindgen::JsValue;
140         let r = ::js_sys::Reflect::set(
141             self.as_ref(),
142             &JsValue::from("portNumber"),
143             &JsValue::from(val),
144         );
145         debug_assert!(
146             r.is_ok(),
147             "setting properties should never fail on our dictionary objects"
148         );
149         let _ = r;
150         self
151     }
152     #[doc = "Change the `transport` field of this object."]
153     #[doc = ""]
154     #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
transport(&mut self, val: &str) -> &mut Self155     pub fn transport(&mut self, val: &str) -> &mut Self {
156         use wasm_bindgen::JsValue;
157         let r = ::js_sys::Reflect::set(
158             self.as_ref(),
159             &JsValue::from("transport"),
160             &JsValue::from(val),
161         );
162         debug_assert!(
163             r.is_ok(),
164             "setting properties should never fail on our dictionary objects"
165         );
166         let _ = r;
167         self
168     }
169 }
170