web_sys/features/
gen_RtcIceCandidateStats.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 = 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    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &RtcIceCandidateStats) -> 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: `RtcIceCandidateStats`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &RtcIceCandidateStats, 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: `RtcIceCandidateStats`*"]
26    #[wasm_bindgen(method, getter = "timestamp")]
27    pub fn get_timestamp(this: &RtcIceCandidateStats) -> 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: `RtcIceCandidateStats`*"]
31    #[wasm_bindgen(method, setter = "timestamp")]
32    pub fn set_timestamp(this: &RtcIceCandidateStats, 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: `RtcIceCandidateStats`, `RtcStatsType`*"]
37    #[wasm_bindgen(method, getter = "type")]
38    pub fn get_type(this: &RtcIceCandidateStats) -> 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: `RtcIceCandidateStats`, `RtcStatsType`*"]
43    #[wasm_bindgen(method, setter = "type")]
44    pub fn set_type(this: &RtcIceCandidateStats, val: RtcStatsType);
45    #[doc = "Get the `candidateId` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
48    #[wasm_bindgen(method, getter = "candidateId")]
49    pub fn get_candidate_id(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>;
50    #[doc = "Change the `candidateId` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
53    #[wasm_bindgen(method, setter = "candidateId")]
54    pub fn set_candidate_id(this: &RtcIceCandidateStats, val: &str);
55    #[cfg(feature = "RtcStatsIceCandidateType")]
56    #[doc = "Get the `candidateType` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"]
59    #[wasm_bindgen(method, getter = "candidateType")]
60    pub fn get_candidate_type(this: &RtcIceCandidateStats) -> Option<RtcStatsIceCandidateType>;
61    #[cfg(feature = "RtcStatsIceCandidateType")]
62    #[doc = "Change the `candidateType` field of this object."]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"]
65    #[wasm_bindgen(method, setter = "candidateType")]
66    pub fn set_candidate_type(this: &RtcIceCandidateStats, val: RtcStatsIceCandidateType);
67    #[doc = "Get the `componentId` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
70    #[wasm_bindgen(method, getter = "componentId")]
71    pub fn get_component_id(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>;
72    #[doc = "Change the `componentId` field of this object."]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
75    #[wasm_bindgen(method, setter = "componentId")]
76    pub fn set_component_id(this: &RtcIceCandidateStats, val: &str);
77    #[doc = "Get the `ipAddress` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
80    #[wasm_bindgen(method, getter = "ipAddress")]
81    pub fn get_ip_address(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>;
82    #[doc = "Change the `ipAddress` field of this object."]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
85    #[wasm_bindgen(method, setter = "ipAddress")]
86    pub fn set_ip_address(this: &RtcIceCandidateStats, val: &str);
87    #[doc = "Get the `portNumber` field of this object."]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
90    #[wasm_bindgen(method, getter = "portNumber")]
91    pub fn get_port_number(this: &RtcIceCandidateStats) -> Option<i32>;
92    #[doc = "Change the `portNumber` field of this object."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
95    #[wasm_bindgen(method, setter = "portNumber")]
96    pub fn set_port_number(this: &RtcIceCandidateStats, val: i32);
97    #[doc = "Get the `transport` field of this object."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
100    #[wasm_bindgen(method, getter = "transport")]
101    pub fn get_transport(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>;
102    #[doc = "Change the `transport` field of this object."]
103    #[doc = ""]
104    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
105    #[wasm_bindgen(method, setter = "transport")]
106    pub fn set_transport(this: &RtcIceCandidateStats, val: &str);
107}
108impl RtcIceCandidateStats {
109    #[doc = "Construct a new `RtcIceCandidateStats`."]
110    #[doc = ""]
111    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"]
112    pub fn new() -> Self {
113        #[allow(unused_mut)]
114        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
115        ret
116    }
117    #[deprecated = "Use `set_id()` instead."]
118    pub fn id(&mut self, val: &str) -> &mut Self {
119        self.set_id(val);
120        self
121    }
122    #[deprecated = "Use `set_timestamp()` instead."]
123    pub fn timestamp(&mut self, val: f64) -> &mut Self {
124        self.set_timestamp(val);
125        self
126    }
127    #[cfg(feature = "RtcStatsType")]
128    #[deprecated = "Use `set_type()` instead."]
129    pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
130        self.set_type(val);
131        self
132    }
133    #[deprecated = "Use `set_candidate_id()` instead."]
134    pub fn candidate_id(&mut self, val: &str) -> &mut Self {
135        self.set_candidate_id(val);
136        self
137    }
138    #[cfg(feature = "RtcStatsIceCandidateType")]
139    #[deprecated = "Use `set_candidate_type()` instead."]
140    pub fn candidate_type(&mut self, val: RtcStatsIceCandidateType) -> &mut Self {
141        self.set_candidate_type(val);
142        self
143    }
144    #[deprecated = "Use `set_component_id()` instead."]
145    pub fn component_id(&mut self, val: &str) -> &mut Self {
146        self.set_component_id(val);
147        self
148    }
149    #[deprecated = "Use `set_ip_address()` instead."]
150    pub fn ip_address(&mut self, val: &str) -> &mut Self {
151        self.set_ip_address(val);
152        self
153    }
154    #[deprecated = "Use `set_port_number()` instead."]
155    pub fn port_number(&mut self, val: i32) -> &mut Self {
156        self.set_port_number(val);
157        self
158    }
159    #[deprecated = "Use `set_transport()` instead."]
160    pub fn transport(&mut self, val: &str) -> &mut Self {
161        self.set_transport(val);
162        self
163    }
164}
165impl Default for RtcIceCandidateStats {
166    fn default() -> Self {
167        Self::new()
168    }
169}