pub enum IpAddress {
V4(Ipv4Address),
V6(Ipv6Address),
}Expand description
An IP address of either family.
Domain objects (routes, interfaces, …) that need to hold “an IP address, either family” use this instead of picking one family, since most networking state (a gateway, a resolver entry) is not inherently v4- or v6-only.
Variants§
V4(Ipv4Address)
V6(Ipv6Address)
Trait Implementations§
impl Copy for IpAddress
impl Eq for IpAddress
Source§impl From<Ipv4Address> for IpAddress
impl From<Ipv4Address> for IpAddress
Source§fn from(value: Ipv4Address) -> IpAddress
fn from(value: Ipv4Address) -> IpAddress
Converts to this type from the input type.
Source§impl From<Ipv6Address> for IpAddress
impl From<Ipv6Address> for IpAddress
Source§fn from(value: Ipv6Address) -> IpAddress
fn from(value: Ipv6Address) -> IpAddress
Converts to this type from the input type.
impl StructuralPartialEq for IpAddress
Auto Trait Implementations§
impl Freeze for IpAddress
impl RefUnwindSafe for IpAddress
impl Send for IpAddress
impl Sync for IpAddress
impl Unpin for IpAddress
impl UnsafeUnpin for IpAddress
impl UnwindSafe for IpAddress
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