#![allow(unused_imports)]
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportStats)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `WebTransportStats` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type WebTransportStats;
#[wasm_bindgen(method, setter = "bytesReceived")]
fn bytes_received_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "bytesSent")]
fn bytes_sent_shim(this: &WebTransportStats, val: f64);
#[cfg(feature = "WebTransportDatagramStats")]
#[wasm_bindgen(method, setter = "datagrams")]
fn datagrams_shim(this: &WebTransportStats, val: &WebTransportDatagramStats);
#[wasm_bindgen(method, setter = "minRtt")]
fn min_rtt_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "numIncomingStreamsCreated")]
fn num_incoming_streams_created_shim(this: &WebTransportStats, val: u32);
#[wasm_bindgen(method, setter = "numOutgoingStreamsCreated")]
fn num_outgoing_streams_created_shim(this: &WebTransportStats, val: u32);
#[wasm_bindgen(method, setter = "packetsLost")]
fn packets_lost_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "packetsReceived")]
fn packets_received_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "packetsSent")]
fn packets_sent_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "rttVariation")]
fn rtt_variation_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "smoothedRtt")]
fn smoothed_rtt_shim(this: &WebTransportStats, val: f64);
#[wasm_bindgen(method, setter = "timestamp")]
fn timestamp_shim(this: &WebTransportStats, val: f64);
}
#[cfg(web_sys_unstable_apis)]
impl WebTransportStats {
#[doc = "Construct a new `WebTransportStats`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `bytesReceived` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn bytes_received(&mut self, val: f64) -> &mut Self {
self.bytes_received_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `bytesSent` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn bytes_sent(&mut self, val: f64) -> &mut Self {
self.bytes_sent_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "WebTransportDatagramStats")]
#[doc = "Change the `datagrams` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`, `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn datagrams(&mut self, val: &WebTransportDatagramStats) -> &mut Self {
self.datagrams_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `minRtt` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn min_rtt(&mut self, val: f64) -> &mut Self {
self.min_rtt_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `numIncomingStreamsCreated` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn num_incoming_streams_created(&mut self, val: u32) -> &mut Self {
self.num_incoming_streams_created_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `numOutgoingStreamsCreated` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn num_outgoing_streams_created(&mut self, val: u32) -> &mut Self {
self.num_outgoing_streams_created_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `packetsLost` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn packets_lost(&mut self, val: f64) -> &mut Self {
self.packets_lost_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `packetsReceived` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn packets_received(&mut self, val: f64) -> &mut Self {
self.packets_received_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `packetsSent` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn packets_sent(&mut self, val: f64) -> &mut Self {
self.packets_sent_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `rttVariation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn rtt_variation(&mut self, val: f64) -> &mut Self {
self.rtt_variation_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `smoothedRtt` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn smoothed_rtt(&mut self, val: f64) -> &mut Self {
self.smoothed_rtt_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `timestamp` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn timestamp(&mut self, val: f64) -> &mut Self {
self.timestamp_shim(val);
self
}
}
#[cfg(web_sys_unstable_apis)]
impl Default for WebTransportStats {
fn default() -> Self {
Self::new()
}
}