pub enum IpAddress {
Ipv4(IpV4Address),
Ipv6(IpV6Address),
}Expand description
An IP address, either IPv4 or IPv6.
Instead of using std::net::IPAddr, this implementation
is geared towards no_std environments and zerocopy decoding.
The size is also consistent across target operating systems.
Variants
Ipv4(IpV4Address)
Ipv6(IpV6Address)
Implementations
Trait Implementations
sourceimpl From<IpV4Address> for IpAddress
impl From<IpV4Address> for IpAddress
sourcefn from(ip: IpV4Address) -> Self
fn from(ip: IpV4Address) -> Self
Converts to this type from the input type.
sourceimpl From<IpV6Address> for IpAddress
impl From<IpV6Address> for IpAddress
sourcefn from(ip: IpV6Address) -> Self
fn from(ip: IpV6Address) -> Self
Converts to this type from the input type.
sourceimpl Ord for IpAddress
impl Ord for IpAddress
sourceimpl PartialOrd<IpAddress> for IpAddress
impl PartialOrd<IpAddress> for IpAddress
sourcefn partial_cmp(&self, other: &IpAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &IpAddress) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl Unspecified for IpAddress
impl Unspecified for IpAddress
sourcefn is_unspecified(&self) -> bool
fn is_unspecified(&self) -> bool
Returns true if the value is unspecified
sourcefn filter_unspecified(self) -> Option<Self>
fn filter_unspecified(self) -> Option<Self>
Coerce a potentially unspecified value into an Option
impl Copy for IpAddress
impl Eq for IpAddress
impl StructuralEq for IpAddress
impl StructuralPartialEq for IpAddress
Auto Trait Implementations
impl RefUnwindSafe for IpAddress
impl Send for IpAddress
impl Sync for IpAddress
impl Unpin for IpAddress
impl UnwindSafe for IpAddress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more