pub struct OverrideNetworkStateParams { /* private fields */ }Expand description
Override the state of navigator.onLine and navigator.connection.
Implementations§
Source§impl OverrideNetworkStateParams
impl OverrideNetworkStateParams
Sourcepub fn builder(
offline: bool,
latency: f64,
download_throughput: f64,
upload_throughput: f64,
) -> OverrideNetworkStateParamsBuilder
pub fn builder( offline: bool, latency: f64, download_throughput: f64, upload_throughput: f64, ) -> OverrideNetworkStateParamsBuilder
Creates a builder for this type with the required parameters:
offline: True to emulate internet disconnection.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 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.
Trait Implementations§
Source§impl<'a> CdpCommand<'a> for OverrideNetworkStateParams
impl<'a> CdpCommand<'a> for OverrideNetworkStateParams
Source§impl Clone for OverrideNetworkStateParams
impl Clone for OverrideNetworkStateParams
Source§fn clone(&self) -> OverrideNetworkStateParams
fn clone(&self) -> OverrideNetworkStateParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OverrideNetworkStateParams
impl Debug for OverrideNetworkStateParams
Source§impl Default for OverrideNetworkStateParams
impl Default for OverrideNetworkStateParams
Source§fn default() -> OverrideNetworkStateParams
fn default() -> OverrideNetworkStateParams
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OverrideNetworkStateParams
impl<'de> Deserialize<'de> for OverrideNetworkStateParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OverrideNetworkStateParams
impl RefUnwindSafe for OverrideNetworkStateParams
impl Send for OverrideNetworkStateParams
impl Sync for OverrideNetworkStateParams
impl Unpin for OverrideNetworkStateParams
impl UnsafeUnpin for OverrideNetworkStateParams
impl UnwindSafe for OverrideNetworkStateParams
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