Struct address::SocketAddressV4
source · pub struct SocketAddressV4 { /* private fields */ }
Expand description
An IPv4 address with an associated port.
Implementations§
source§impl SocketAddressV4
impl SocketAddressV4
Conversions
sourcepub const fn to_socket(&self) -> SocketAddress
pub const fn to_socket(&self) -> SocketAddress
Converts the IPv4 socket address to a socket address.
source§impl SocketAddressV4
impl SocketAddressV4
Standard Library Conversions
sourcepub const fn to_std(&self) -> SocketAddrV4
pub const fn to_std(&self) -> SocketAddrV4
Converts the address to a standard library address.
source§impl SocketAddressV4
impl SocketAddressV4
Construction
sourcepub const fn new(ip: IPv4Address, port: u16) -> Self
pub const fn new(ip: IPv4Address, port: u16) -> Self
Creates a new socket address.
source§impl SocketAddressV4
impl SocketAddressV4
Properties
Trait Implementations§
source§impl Clone for SocketAddressV4
impl Clone for SocketAddressV4
source§fn clone(&self) -> SocketAddressV4
fn clone(&self) -> SocketAddressV4
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 SocketAddressV4
impl Debug for SocketAddressV4
source§impl Display for SocketAddressV4
impl Display for SocketAddressV4
source§impl<A: Into<IPv4Address>> From<(A, u16)> for SocketAddressV4
impl<A: Into<IPv4Address>> From<(A, u16)> for SocketAddressV4
source§impl From<SocketAddrV4> for SocketAddressV4
impl From<SocketAddrV4> for SocketAddressV4
source§fn from(std: SocketAddrV4) -> Self
fn from(std: SocketAddrV4) -> Self
Converts to this type from the input type.
source§impl From<SocketAddressV4> for SocketAddrV4
impl From<SocketAddressV4> for SocketAddrV4
source§fn from(socket: SocketAddressV4) -> Self
fn from(socket: SocketAddressV4) -> Self
Converts to this type from the input type.
source§impl FromStr for SocketAddressV4
impl FromStr for SocketAddressV4
source§impl Hash for SocketAddressV4
impl Hash for SocketAddressV4
source§impl Ord for SocketAddressV4
impl Ord for SocketAddressV4
source§fn cmp(&self, other: &SocketAddressV4) -> Ordering
fn cmp(&self, other: &SocketAddressV4) -> 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 SocketAddressV4
impl PartialEq for SocketAddressV4
source§fn eq(&self, other: &SocketAddressV4) -> bool
fn eq(&self, other: &SocketAddressV4) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SocketAddressV4
impl PartialOrd for SocketAddressV4
source§fn partial_cmp(&self, other: &SocketAddressV4) -> Option<Ordering>
fn partial_cmp(&self, other: &SocketAddressV4) -> 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 SocketAddressV4
impl Eq for SocketAddressV4
impl StructuralPartialEq for SocketAddressV4
Auto Trait Implementations§
impl Freeze for SocketAddressV4
impl RefUnwindSafe for SocketAddressV4
impl Send for SocketAddressV4
impl Sync for SocketAddressV4
impl Unpin for SocketAddressV4
impl UnwindSafe for SocketAddressV4
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