pub struct ConnectivityResult {
pub is_connected: bool,
pub latency_ms: Option<u64>,
pub target: String,
}Expand description
Result of an internet connectivity check.
Returned by WifiManager::check_connectivity().
§Example
use rpi_host::WifiManager;
let wifi = WifiManager::new()?;
let result = wifi.check_connectivity()?;
if result.is_connected {
println!("Internet OK! Latency: {:?}ms to {}", result.latency_ms, result.target);
} else {
println!("No internet connection");
}Fields§
§is_connected: boolWhether the connectivity check succeeded.
latency_ms: Option<u64>Round-trip latency in milliseconds.
Some(ms) if connected, None if not.
target: StringThe target that was checked (IP address or hostname).
Trait Implementations§
Source§impl Clone for ConnectivityResult
impl Clone for ConnectivityResult
Source§fn clone(&self) -> ConnectivityResult
fn clone(&self) -> ConnectivityResult
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 ConnectivityResult
impl RefUnwindSafe for ConnectivityResult
impl Send for ConnectivityResult
impl Sync for ConnectivityResult
impl Unpin for ConnectivityResult
impl UnwindSafe for ConnectivityResult
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