web_sys/features/
gen_WebTransportStats.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportStats)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `WebTransportStats` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
13 #[doc = ""]
14 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type WebTransportStats;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `bytesReceived` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "bytesReceived")]
25 pub fn get_bytes_received(this: &WebTransportStats) -> Option<f64>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `bytesReceived` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "bytesReceived")]
34 pub fn set_bytes_received(this: &WebTransportStats, val: f64);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `bytesSent` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, getter = "bytesSent")]
43 pub fn get_bytes_sent(this: &WebTransportStats) -> Option<f64>;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `bytesSent` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "bytesSent")]
52 pub fn set_bytes_sent(this: &WebTransportStats, val: f64);
53 #[cfg(web_sys_unstable_apis)]
54 #[cfg(feature = "WebTransportDatagramStats")]
55 #[doc = "Get the `datagrams` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`, `WebTransportStats`*"]
58 #[doc = ""]
59 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
60 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
61 #[wasm_bindgen(method, getter = "datagrams")]
62 pub fn get_datagrams(this: &WebTransportStats) -> Option<WebTransportDatagramStats>;
63 #[cfg(web_sys_unstable_apis)]
64 #[cfg(feature = "WebTransportDatagramStats")]
65 #[doc = "Change the `datagrams` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`, `WebTransportStats`*"]
68 #[doc = ""]
69 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71 #[wasm_bindgen(method, setter = "datagrams")]
72 pub fn set_datagrams(this: &WebTransportStats, val: &WebTransportDatagramStats);
73 #[cfg(web_sys_unstable_apis)]
74 #[doc = "Get the `minRtt` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
77 #[doc = ""]
78 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80 #[wasm_bindgen(method, getter = "minRtt")]
81 pub fn get_min_rtt(this: &WebTransportStats) -> Option<f64>;
82 #[cfg(web_sys_unstable_apis)]
83 #[doc = "Change the `minRtt` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
86 #[doc = ""]
87 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
89 #[wasm_bindgen(method, setter = "minRtt")]
90 pub fn set_min_rtt(this: &WebTransportStats, val: f64);
91 #[cfg(web_sys_unstable_apis)]
92 #[doc = "Get the `numIncomingStreamsCreated` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 #[wasm_bindgen(method, getter = "numIncomingStreamsCreated")]
99 pub fn get_num_incoming_streams_created(this: &WebTransportStats) -> Option<u32>;
100 #[cfg(web_sys_unstable_apis)]
101 #[doc = "Change the `numIncomingStreamsCreated` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
104 #[doc = ""]
105 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 #[wasm_bindgen(method, setter = "numIncomingStreamsCreated")]
108 pub fn set_num_incoming_streams_created(this: &WebTransportStats, val: u32);
109 #[cfg(web_sys_unstable_apis)]
110 #[doc = "Get the `numOutgoingStreamsCreated` field of this object."]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
113 #[doc = ""]
114 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
115 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
116 #[wasm_bindgen(method, getter = "numOutgoingStreamsCreated")]
117 pub fn get_num_outgoing_streams_created(this: &WebTransportStats) -> Option<u32>;
118 #[cfg(web_sys_unstable_apis)]
119 #[doc = "Change the `numOutgoingStreamsCreated` field of this object."]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
122 #[doc = ""]
123 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
125 #[wasm_bindgen(method, setter = "numOutgoingStreamsCreated")]
126 pub fn set_num_outgoing_streams_created(this: &WebTransportStats, val: u32);
127 #[cfg(web_sys_unstable_apis)]
128 #[doc = "Get the `packetsLost` field of this object."]
129 #[doc = ""]
130 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
131 #[doc = ""]
132 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
133 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
134 #[wasm_bindgen(method, getter = "packetsLost")]
135 pub fn get_packets_lost(this: &WebTransportStats) -> Option<f64>;
136 #[cfg(web_sys_unstable_apis)]
137 #[doc = "Change the `packetsLost` field of this object."]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
140 #[doc = ""]
141 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
142 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
143 #[wasm_bindgen(method, setter = "packetsLost")]
144 pub fn set_packets_lost(this: &WebTransportStats, val: f64);
145 #[cfg(web_sys_unstable_apis)]
146 #[doc = "Get the `packetsReceived` field of this object."]
147 #[doc = ""]
148 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
149 #[doc = ""]
150 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
151 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
152 #[wasm_bindgen(method, getter = "packetsReceived")]
153 pub fn get_packets_received(this: &WebTransportStats) -> Option<f64>;
154 #[cfg(web_sys_unstable_apis)]
155 #[doc = "Change the `packetsReceived` field of this object."]
156 #[doc = ""]
157 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
158 #[doc = ""]
159 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
160 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
161 #[wasm_bindgen(method, setter = "packetsReceived")]
162 pub fn set_packets_received(this: &WebTransportStats, val: f64);
163 #[cfg(web_sys_unstable_apis)]
164 #[doc = "Get the `packetsSent` field of this object."]
165 #[doc = ""]
166 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
167 #[doc = ""]
168 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
169 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
170 #[wasm_bindgen(method, getter = "packetsSent")]
171 pub fn get_packets_sent(this: &WebTransportStats) -> Option<f64>;
172 #[cfg(web_sys_unstable_apis)]
173 #[doc = "Change the `packetsSent` field of this object."]
174 #[doc = ""]
175 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
176 #[doc = ""]
177 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
178 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
179 #[wasm_bindgen(method, setter = "packetsSent")]
180 pub fn set_packets_sent(this: &WebTransportStats, val: f64);
181 #[cfg(web_sys_unstable_apis)]
182 #[doc = "Get the `rttVariation` field of this object."]
183 #[doc = ""]
184 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
185 #[doc = ""]
186 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
187 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
188 #[wasm_bindgen(method, getter = "rttVariation")]
189 pub fn get_rtt_variation(this: &WebTransportStats) -> Option<f64>;
190 #[cfg(web_sys_unstable_apis)]
191 #[doc = "Change the `rttVariation` field of this object."]
192 #[doc = ""]
193 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
194 #[doc = ""]
195 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
196 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
197 #[wasm_bindgen(method, setter = "rttVariation")]
198 pub fn set_rtt_variation(this: &WebTransportStats, val: f64);
199 #[cfg(web_sys_unstable_apis)]
200 #[doc = "Get the `smoothedRtt` field of this object."]
201 #[doc = ""]
202 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
203 #[doc = ""]
204 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
205 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
206 #[wasm_bindgen(method, getter = "smoothedRtt")]
207 pub fn get_smoothed_rtt(this: &WebTransportStats) -> Option<f64>;
208 #[cfg(web_sys_unstable_apis)]
209 #[doc = "Change the `smoothedRtt` field of this object."]
210 #[doc = ""]
211 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
212 #[doc = ""]
213 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
214 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
215 #[wasm_bindgen(method, setter = "smoothedRtt")]
216 pub fn set_smoothed_rtt(this: &WebTransportStats, val: f64);
217 #[cfg(web_sys_unstable_apis)]
218 #[doc = "Get the `timestamp` field of this object."]
219 #[doc = ""]
220 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
221 #[doc = ""]
222 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
223 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
224 #[wasm_bindgen(method, getter = "timestamp")]
225 pub fn get_timestamp(this: &WebTransportStats) -> Option<f64>;
226 #[cfg(web_sys_unstable_apis)]
227 #[doc = "Change the `timestamp` field of this object."]
228 #[doc = ""]
229 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
230 #[doc = ""]
231 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
232 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
233 #[wasm_bindgen(method, setter = "timestamp")]
234 pub fn set_timestamp(this: &WebTransportStats, val: f64);
235}
236#[cfg(web_sys_unstable_apis)]
237impl WebTransportStats {
238 #[doc = "Construct a new `WebTransportStats`."]
239 #[doc = ""]
240 #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
241 #[doc = ""]
242 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
243 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
244 pub fn new() -> Self {
245 #[allow(unused_mut)]
246 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
247 ret
248 }
249 #[cfg(web_sys_unstable_apis)]
250 #[deprecated = "Use `set_bytes_received()` instead."]
251 pub fn bytes_received(&mut self, val: f64) -> &mut Self {
252 self.set_bytes_received(val);
253 self
254 }
255 #[cfg(web_sys_unstable_apis)]
256 #[deprecated = "Use `set_bytes_sent()` instead."]
257 pub fn bytes_sent(&mut self, val: f64) -> &mut Self {
258 self.set_bytes_sent(val);
259 self
260 }
261 #[cfg(web_sys_unstable_apis)]
262 #[cfg(feature = "WebTransportDatagramStats")]
263 #[deprecated = "Use `set_datagrams()` instead."]
264 pub fn datagrams(&mut self, val: &WebTransportDatagramStats) -> &mut Self {
265 self.set_datagrams(val);
266 self
267 }
268 #[cfg(web_sys_unstable_apis)]
269 #[deprecated = "Use `set_min_rtt()` instead."]
270 pub fn min_rtt(&mut self, val: f64) -> &mut Self {
271 self.set_min_rtt(val);
272 self
273 }
274 #[cfg(web_sys_unstable_apis)]
275 #[deprecated = "Use `set_num_incoming_streams_created()` instead."]
276 pub fn num_incoming_streams_created(&mut self, val: u32) -> &mut Self {
277 self.set_num_incoming_streams_created(val);
278 self
279 }
280 #[cfg(web_sys_unstable_apis)]
281 #[deprecated = "Use `set_num_outgoing_streams_created()` instead."]
282 pub fn num_outgoing_streams_created(&mut self, val: u32) -> &mut Self {
283 self.set_num_outgoing_streams_created(val);
284 self
285 }
286 #[cfg(web_sys_unstable_apis)]
287 #[deprecated = "Use `set_packets_lost()` instead."]
288 pub fn packets_lost(&mut self, val: f64) -> &mut Self {
289 self.set_packets_lost(val);
290 self
291 }
292 #[cfg(web_sys_unstable_apis)]
293 #[deprecated = "Use `set_packets_received()` instead."]
294 pub fn packets_received(&mut self, val: f64) -> &mut Self {
295 self.set_packets_received(val);
296 self
297 }
298 #[cfg(web_sys_unstable_apis)]
299 #[deprecated = "Use `set_packets_sent()` instead."]
300 pub fn packets_sent(&mut self, val: f64) -> &mut Self {
301 self.set_packets_sent(val);
302 self
303 }
304 #[cfg(web_sys_unstable_apis)]
305 #[deprecated = "Use `set_rtt_variation()` instead."]
306 pub fn rtt_variation(&mut self, val: f64) -> &mut Self {
307 self.set_rtt_variation(val);
308 self
309 }
310 #[cfg(web_sys_unstable_apis)]
311 #[deprecated = "Use `set_smoothed_rtt()` instead."]
312 pub fn smoothed_rtt(&mut self, val: f64) -> &mut Self {
313 self.set_smoothed_rtt(val);
314 self
315 }
316 #[cfg(web_sys_unstable_apis)]
317 #[deprecated = "Use `set_timestamp()` instead."]
318 pub fn timestamp(&mut self, val: f64) -> &mut Self {
319 self.set_timestamp(val);
320 self
321 }
322}
323#[cfg(web_sys_unstable_apis)]
324impl Default for WebTransportStats {
325 fn default() -> Self {
326 Self::new()
327 }
328}