pub struct SockAddrIp(/* private fields */);
Expand description
Represents a socket address that can be for either an IPv4 socket or an IPv6 socket, chosen dynamically at runtime.
Implementations§
Source§impl SockAddrIp
impl SockAddrIp
pub fn new(host_address: impl Into<IpAddr>, port: u16) -> Self
Sourcepub const fn address_family(&self) -> sa_family_t
pub const fn address_family(&self) -> sa_family_t
Sourcepub const fn host_address(&self) -> IpAddr
pub const fn host_address(&self) -> IpAddr
Get the IP address associated with the socket address.
The result can be either an IPv4 or IPv6 address depending on the address family of the socket address.
Trait Implementations§
Source§impl Clone for SockAddrIp
impl Clone for SockAddrIp
Source§fn clone(&self) -> SockAddrIp
fn clone(&self) -> SockAddrIp
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 SockAddrIp
impl Debug for SockAddrIp
Source§impl SockAddr for SockAddrIp
impl SockAddr for SockAddrIp
impl Copy for SockAddrIp
Auto Trait Implementations§
impl Freeze for SockAddrIp
impl RefUnwindSafe for SockAddrIp
impl Send for SockAddrIp
impl Sync for SockAddrIp
impl Unpin for SockAddrIp
impl UnwindSafe for SockAddrIp
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