pub struct NetworkProfile {
pub rtt: u32,
pub downlink: f64,
pub effective_type: String,
pub save_data: bool,
}Expand description
Network configuration (NetworkInformation API).
§Example
use stygian_browser::profile::NetworkProfile;
let n = NetworkProfile::fast_wifi();
assert_eq!(n.effective_type, "4g");Fields§
§rtt: u32Round-trip time in milliseconds.
downlink: f64Downlink speed in Mbps.
effective_type: StringEffective connection type ("4g", "3g", etc.).
save_data: boolnavigator.connection.saveData.
Implementations§
Trait Implementations§
Source§impl Clone for NetworkProfile
impl Clone for NetworkProfile
Source§fn clone(&self) -> NetworkProfile
fn clone(&self) -> NetworkProfile
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 moreSource§impl Debug for NetworkProfile
impl Debug for NetworkProfile
Source§impl<'de> Deserialize<'de> for NetworkProfile
impl<'de> Deserialize<'de> for NetworkProfile
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 NetworkProfile
impl RefUnwindSafe for NetworkProfile
impl Send for NetworkProfile
impl Sync for NetworkProfile
impl Unpin for NetworkProfile
impl UnsafeUnpin for NetworkProfile
impl UnwindSafe for NetworkProfile
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