pub struct NetworkConditions<'a> { /* private fields */ }Implementations§
Source§impl<'a> NetworkConditions<'a>
impl<'a> NetworkConditions<'a>
Sourcepub fn builder(
url_pattern: impl Into<Cow<'a, str>>,
latency: f64,
download_throughput: f64,
upload_throughput: f64,
) -> NetworkConditionsBuilder<'a>
pub fn builder( url_pattern: impl Into<Cow<'a, str>>, latency: f64, download_throughput: f64, upload_throughput: f64, ) -> NetworkConditionsBuilder<'a>
Creates a builder for this type with the required parameters:
url_pattern: Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are matched (including p2p connections).latency: Minimum latency from request sent to response headers received (ms).download_throughput: Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.upload_throughput: Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
Sourcepub fn url_pattern(&self) -> &str
pub fn url_pattern(&self) -> &str
Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are matched (including p2p connections).
Sourcepub fn latency(&self) -> f64
pub fn latency(&self) -> f64
Minimum latency from request sent to response headers received (ms).
Sourcepub fn download_throughput(&self) -> f64
pub fn download_throughput(&self) -> f64
Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
Sourcepub fn upload_throughput(&self) -> f64
pub fn upload_throughput(&self) -> f64
Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
Sourcepub fn connection_type(&self) -> Option<&ConnectionType>
pub fn connection_type(&self) -> Option<&ConnectionType>
Connection type if known.
Sourcepub fn packet_loss(&self) -> Option<f64>
pub fn packet_loss(&self) -> Option<f64>
WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
Sourcepub fn packet_queue_length(&self) -> Option<u64>
pub fn packet_queue_length(&self) -> Option<u64>
WebRTC packet queue length (packet). 0 removes any queue length limitations.
Sourcepub fn packet_reordering(&self) -> Option<bool>
pub fn packet_reordering(&self) -> Option<bool>
WebRTC packetReordering feature.
Trait Implementations§
Source§impl<'a> Clone for NetworkConditions<'a>
impl<'a> Clone for NetworkConditions<'a>
Source§fn clone(&self) -> NetworkConditions<'a>
fn clone(&self) -> NetworkConditions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more