#[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 moreSource§impl Debug for SockAddrIpv4
impl Debug for SockAddrIpv4
Source§impl SockAddr for SockAddrIpv4
impl SockAddr for SockAddrIpv4
impl Copy for SockAddrIpv4
Auto Trait Implementations§
impl Freeze for SockAddrIpv4
impl RefUnwindSafe for SockAddrIpv4
impl Send for SockAddrIpv4
impl Sync for SockAddrIpv4
impl Unpin for SockAddrIpv4
impl UnwindSafe for SockAddrIpv4
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