Struct linux_io::socket::ip::SockAddrIp
source · #[repr(transparent)]pub struct SockAddrIp(_);
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 more