]> git.proxmox.com Git - rustc.git/blame - vendor/web-sys/src/features/gen_RtcIceCandidateStats.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / vendor / web-sys / src / features / gen_RtcIceCandidateStats.rs
CommitLineData
49aad941 1#![allow(unused_imports)]
fe692bf9 2#![allow(clippy::all)]
49aad941
FG
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCIceCandidateStats)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `RtcIceCandidateStats` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
12 pub type RtcIceCandidateStats;
13}
14impl RtcIceCandidateStats {
15 #[doc = "Construct a new `RtcIceCandidateStats`."]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
18 pub fn new() -> Self {
19 #[allow(unused_mut)]
20 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21 ret
22 }
23 #[doc = "Change the `id` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
26 pub fn id(&mut self, val: &str) -> &mut Self {
27 use wasm_bindgen::JsValue;
28 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val));
29 debug_assert!(
30 r.is_ok(),
31 "setting properties should never fail on our dictionary objects"
32 );
33 let _ = r;
34 self
35 }
36 #[doc = "Change the `timestamp` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
39 pub fn timestamp(&mut self, val: f64) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(
42 self.as_ref(),
43 &JsValue::from("timestamp"),
44 &JsValue::from(val),
45 );
46 debug_assert!(
47 r.is_ok(),
48 "setting properties should never fail on our dictionary objects"
49 );
50 let _ = r;
51 self
52 }
53 #[cfg(feature = "RtcStatsType")]
54 #[doc = "Change the `type` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsType`*"]
57 pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
58 use wasm_bindgen::JsValue;
59 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
60 debug_assert!(
61 r.is_ok(),
62 "setting properties should never fail on our dictionary objects"
63 );
64 let _ = r;
65 self
66 }
67 #[doc = "Change the `candidateId` field of this object."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
70 pub fn candidate_id(&mut self, val: &str) -> &mut Self {
71 use wasm_bindgen::JsValue;
72 let r = ::js_sys::Reflect::set(
73 self.as_ref(),
74 &JsValue::from("candidateId"),
75 &JsValue::from(val),
76 );
77 debug_assert!(
78 r.is_ok(),
79 "setting properties should never fail on our dictionary objects"
80 );
81 let _ = r;
82 self
83 }
84 #[cfg(feature = "RtcStatsIceCandidateType")]
85 #[doc = "Change the `candidateType` field of this object."]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"]
88 pub fn candidate_type(&mut self, val: RtcStatsIceCandidateType) -> &mut Self {
89 use wasm_bindgen::JsValue;
90 let r = ::js_sys::Reflect::set(
91 self.as_ref(),
92 &JsValue::from("candidateType"),
93 &JsValue::from(val),
94 );
95 debug_assert!(
96 r.is_ok(),
97 "setting properties should never fail on our dictionary objects"
98 );
99 let _ = r;
100 self
101 }
102 #[doc = "Change the `componentId` field of this object."]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
105 pub fn component_id(&mut self, val: &str) -> &mut Self {
106 use wasm_bindgen::JsValue;
107 let r = ::js_sys::Reflect::set(
108 self.as_ref(),
109 &JsValue::from("componentId"),
110 &JsValue::from(val),
111 );
112 debug_assert!(
113 r.is_ok(),
114 "setting properties should never fail on our dictionary objects"
115 );
116 let _ = r;
117 self
118 }
119 #[doc = "Change the `ipAddress` field of this object."]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
122 pub fn ip_address(&mut self, val: &str) -> &mut Self {
123 use wasm_bindgen::JsValue;
124 let r = ::js_sys::Reflect::set(
125 self.as_ref(),
126 &JsValue::from("ipAddress"),
127 &JsValue::from(val),
128 );
129 debug_assert!(
130 r.is_ok(),
131 "setting properties should never fail on our dictionary objects"
132 );
133 let _ = r;
134 self
135 }
136 #[doc = "Change the `portNumber` field of this object."]
137 #[doc = ""]
138 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
139 pub fn port_number(&mut self, val: i32) -> &mut Self {
140 use wasm_bindgen::JsValue;
141 let r = ::js_sys::Reflect::set(
142 self.as_ref(),
143 &JsValue::from("portNumber"),
144 &JsValue::from(val),
145 );
146 debug_assert!(
147 r.is_ok(),
148 "setting properties should never fail on our dictionary objects"
149 );
150 let _ = r;
151 self
152 }
153 #[doc = "Change the `transport` field of this object."]
154 #[doc = ""]
155 #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
156 pub fn transport(&mut self, val: &str) -> &mut Self {
157 use wasm_bindgen::JsValue;
158 let r = ::js_sys::Reflect::set(
159 self.as_ref(),
160 &JsValue::from("transport"),
161 &JsValue::from(val),
162 );
163 debug_assert!(
164 r.is_ok(),
165 "setting properties should never fail on our dictionary objects"
166 );
167 let _ = r;
168 self
169 }
170}
171impl Default for RtcIceCandidateStats {
172 fn default() -> Self {
173 Self::new()
174 }
175}