Enum s2n_quic_core::inet::ip::IpAddress
source · 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§
source§impl IpAddress
impl IpAddress
sourcepub fn unmap(self) -> Self
pub fn unmap(self) -> Self
Converts the IP address into IPv4 if it is mapped, otherwise the address is unchanged
sourcepub fn to_ipv6_mapped(self) -> IpV6Address
pub fn to_ipv6_mapped(self) -> IpV6Address
Converts the IP address into IPv6 if it is IPv4, otherwise the address is unchanged
pub fn with_port(self, port: u16) -> SocketAddress
Trait Implementations§
source§impl From<IpV4Address> for IpAddress
impl From<IpV4Address> for IpAddress
source§fn from(ip: IpV4Address) -> Self
fn from(ip: IpV4Address) -> Self
Converts to this type from the input type.
source§impl From<IpV6Address> for IpAddress
impl From<IpV6Address> for IpAddress
source§fn from(ip: IpV6Address) -> Self
fn from(ip: IpV6Address) -> Self
Converts to this type from the input type.
source§impl Ord for IpAddress
impl Ord for IpAddress
source§impl PartialEq for IpAddress
impl PartialEq for IpAddress
source§impl PartialOrd for IpAddress
impl PartialOrd for IpAddress
1.0.0 · source§fn 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 moresource§impl Unspecified for IpAddress
impl Unspecified for IpAddress
source§fn is_unspecified(&self) -> bool
fn is_unspecified(&self) -> bool
Returns true if the value is unspecified
source§fn 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§
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