pub struct NetworkConditionsBuilder { /* private fields */ }Expand description
Builder for NetworkConditions.
Implementations§
Source§impl NetworkConditionsBuilder
impl NetworkConditionsBuilder
Sourcepub fn url_pattern<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn url_pattern<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
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<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn latency<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Minimum latency from request sent to response headers received (ms).
Sourcepub fn download_throughput<VALUE: Into<JsFloat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn download_throughput<VALUE: Into<JsFloat>>( &mut self, value: VALUE, ) -> &mut Self
Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
Sourcepub fn upload_throughput<VALUE: Into<JsFloat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn upload_throughput<VALUE: Into<JsFloat>>( &mut self, value: VALUE, ) -> &mut Self
Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
Sourcepub fn connection_type<VALUE: Into<ConnectionType>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn connection_type<VALUE: Into<ConnectionType>>( &mut self, value: VALUE, ) -> &mut Self
Connection type if known.
Sourcepub fn packet_loss<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn packet_loss<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
Sourcepub fn packet_queue_length<VALUE: Into<JsUInt>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn packet_queue_length<VALUE: Into<JsUInt>>( &mut self, value: VALUE, ) -> &mut Self
WebRTC packet queue length (packet). 0 removes any queue length limitations.
Sourcepub fn packet_reordering<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn packet_reordering<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
WebRTC packetReordering feature.
Sourcepub fn build(&self) -> Result<NetworkConditions, NetworkConditionsBuilderError>
pub fn build(&self) -> Result<NetworkConditions, NetworkConditionsBuilderError>
Trait Implementations§
Source§impl Clone for NetworkConditionsBuilder
impl Clone for NetworkConditionsBuilder
Source§fn clone(&self) -> NetworkConditionsBuilder
fn clone(&self) -> NetworkConditionsBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NetworkConditionsBuilder
impl RefUnwindSafe for NetworkConditionsBuilder
impl Send for NetworkConditionsBuilder
impl Sync for NetworkConditionsBuilder
impl Unpin for NetworkConditionsBuilder
impl UnsafeUnpin for NetworkConditionsBuilder
impl UnwindSafe for NetworkConditionsBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more