#[non_exhaustive]pub struct IfaceAddr {
pub cidr: IpCidr,
pub origin: AddrOrigin,
pub preferred: Preferred,
}Expand description
An IP address assigned to an interface.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cidr: IpCidrThe address and its prefix.
origin: AddrOriginWhere the address came from.
preferred: PreferredWhether the address is preferred or deprecated (RFC 4862 section 5.5.4).
Only SLAAC sets anything but Preferred::Always: a router advertises a
preferred lifetime alongside the valid one, and shortens it to zero to
signal that a prefix is on its way out while addresses formed from it
still work.
Implementations§
Source§impl IfaceAddr
impl IfaceAddr
Sourcepub fn is_preferred(&self) -> bool
pub fn is_preferred(&self) -> bool
Whether the address is preferred, i.e. not deprecated.
An address whose preferred lifetime ran out becomes Preferred::Never
at the stack’s next poll.
Trait Implementations§
impl Copy for IfaceAddr
impl Eq for IfaceAddr
impl StructuralPartialEq for IfaceAddr
Auto Trait Implementations§
impl Freeze for IfaceAddr
impl RefUnwindSafe for IfaceAddr
impl Send for IfaceAddr
impl Sync for IfaceAddr
impl Unpin for IfaceAddr
impl UnsafeUnpin for IfaceAddr
impl UnwindSafe for IfaceAddr
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