Struct address::IPv4Address
source · pub struct IPv4Address { /* private fields */ }
Expand description
An IPv4 address. (a.b.c.d)
Implementations§
source§impl IPv4Address
impl IPv4Address
Conversions
sourcepub const fn to_v6_compatible(&self) -> IPv6Address
pub const fn to_v6_compatible(&self) -> IPv6Address
Converts the address to an IPv6 compatible address. (::a.b.c.d)
sourcepub const fn to_v6_mapped(&self) -> IPv6Address
pub const fn to_v6_mapped(&self) -> IPv6Address
Converts the address to an IPv6 mapped address. (::ffff:a.b.c.d)
sourcepub const fn to_socket(&self, port: u16) -> SocketAddressV4
pub const fn to_socket(&self, port: u16) -> SocketAddressV4
Converts the address to a socket address with the port.
sourcepub const fn to_host_ref(&self) -> HostRef<'_>
pub const fn to_host_ref(&self) -> HostRef<'_>
Converts the address to a host reference.
source§impl IPv4Address
impl IPv4Address
Standard Library Conversions
source§impl IPv4Address
impl IPv4Address
Special Addresses
source§impl IPv4Address
impl IPv4Address
Construction
Trait Implementations§
source§impl Clone for IPv4Address
impl Clone for IPv4Address
source§fn clone(&self) -> IPv4Address
fn clone(&self) -> IPv4Address
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for IPv4Address
impl Debug for IPv4Address
source§impl Default for IPv4Address
impl Default for IPv4Address
source§fn default() -> IPv4Address
fn default() -> IPv4Address
Returns the “default value” for a type. Read more
source§impl Display for IPv4Address
impl Display for IPv4Address
source§impl From<IPv4Address> for [u8; 4]
impl From<IPv4Address> for [u8; 4]
source§fn from(ip: IPv4Address) -> Self
fn from(ip: IPv4Address) -> Self
Converts to this type from the input type.
source§impl From<IPv4Address> for (u8, u8, u8, u8)
impl From<IPv4Address> for (u8, u8, u8, u8)
source§fn from(ip: IPv4Address) -> Self
fn from(ip: IPv4Address) -> Self
Converts to this type from the input type.
source§impl From<IPv4Address> for IPAddress
impl From<IPv4Address> for IPAddress
source§fn from(v4: IPv4Address) -> Self
fn from(v4: IPv4Address) -> Self
Converts to this type from the input type.
source§impl From<IPv4Address> for Ipv4Addr
impl From<IPv4Address> for Ipv4Addr
source§fn from(ip: IPv4Address) -> Self
fn from(ip: IPv4Address) -> Self
Converts to this type from the input type.
source§impl From<IPv4Address> for u32
impl From<IPv4Address> for u32
source§fn from(ip: IPv4Address) -> Self
fn from(ip: IPv4Address) -> Self
Converts to this type from the input type.
source§impl From<Ipv4Addr> for IPv4Address
impl From<Ipv4Addr> for IPv4Address
source§impl From<u32> for IPv4Address
impl From<u32> for IPv4Address
source§impl FromStr for IPv4Address
impl FromStr for IPv4Address
source§impl Hash for IPv4Address
impl Hash for IPv4Address
source§impl Ord for IPv4Address
impl Ord for IPv4Address
source§fn cmp(&self, other: &IPv4Address) -> Ordering
fn cmp(&self, other: &IPv4Address) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for IPv4Address
impl PartialEq for IPv4Address
source§fn eq(&self, other: &IPv4Address) -> bool
fn eq(&self, other: &IPv4Address) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for IPv4Address
impl PartialOrd for IPv4Address
source§fn partial_cmp(&self, other: &IPv4Address) -> Option<Ordering>
fn partial_cmp(&self, other: &IPv4Address) -> Option<Ordering>
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 moreimpl Copy for IPv4Address
impl Eq for IPv4Address
impl StructuralPartialEq for IPv4Address
Auto Trait Implementations§
impl Freeze for IPv4Address
impl RefUnwindSafe for IPv4Address
impl Send for IPv4Address
impl Sync for IPv4Address
impl Unpin for IPv4Address
impl UnwindSafe for IPv4Address
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