Struct linux_io::sockaddr::ip::SockAddrIpv4
source · #[repr(C, align(8))]pub struct SockAddrIpv4 { /* private fields */ }
Expand description
Socket address type for the IPv4 protocol family.
Implementations§
source§impl SockAddrIpv4
impl SockAddrIpv4
sourcepub const fn new(host_addr: Ipv4Addr, port: u16) -> Self
pub const fn new(host_addr: Ipv4Addr, port: u16) -> Self
Create a new SockAddrIpv4
with the specified IP address and port
number.
Port number should be provided in the host’s native byte order. This function will convert it to network byte order where necessary.
sourcepub const fn host_address(&self) -> Ipv4Addr
pub const fn host_address(&self) -> Ipv4Addr
Returns the host address part of the socket address.
Trait Implementations§
source§impl Clone for SockAddrIpv4
impl Clone for SockAddrIpv4
source§fn clone(&self) -> SockAddrIpv4
fn clone(&self) -> SockAddrIpv4
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