pub struct Status {
pub ip: Ipv4,
pub gateway: Ipv4,
pub gateway_mac: [u8; 6],
pub dns: Ipv4,
pub gateway_resolved: bool,
pub ping_ok: bool,
pub leased: bool,
}Expand description
What the machine currently believes about the network.
A snapshot, not a subscription: net-stack re-reads the link when asked, so a cable pulled since
the last call shows up on the next one rather than being cached into a comfortable lie.
Fields§
§ip: Ipv4Our address. All zeroes means unconfigured.
gateway: Ipv4The default gateway.
gateway_mac: [u8; 6]The gateway’s MAC, valid only when gateway_resolved.
dns: Ipv4The DNS server, from the lease.
gateway_resolved: boolARP has resolved the gateway, so traffic can leave.
ping_ok: boolA ping has succeeded at least once.
leased: boolDHCP granted this address, as opposed to it being a fallback guess. This is the difference between configured and merely reachable, and it is the bit worth asserting on: a receive path that has stopped working shows up here as a stack that never got a lease.
Implementations§
Trait Implementations§
impl Copy for Status
impl Eq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnsafeUnpin for Status
impl UnwindSafe for Status
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