#[repr(C)]pub struct Inet4SocketAddress { /* private fields */ }
Expand description
IPv4 socket address.
This includes an IPv4 address and a 16-bit port number.
Implementations§
Source§impl Inet4SocketAddress
impl Inet4SocketAddress
Sourcepub fn new(ip: &Ipv4Addr, port: u16) -> Self
pub fn new(ip: &Ipv4Addr, port: u16) -> Self
Create an IPv4 socket address from an IP address and a port number.
Sourcepub fn from_raw(inner: sockaddr_in) -> Self
pub fn from_raw(inner: sockaddr_in) -> Self
Create an IPv4 socket address from a libc::sockaddr_in
.
Sourcepub fn into_raw(self) -> sockaddr_in
pub fn into_raw(self) -> sockaddr_in
Convert the [SocketAddress
] into raw libc
parts.
Trait Implementations§
Source§impl AsSocketAddress for Inet4SocketAddress
impl AsSocketAddress for Inet4SocketAddress
Source§fn as_sockaddr_mut(address: &mut MaybeUninit<Self>) -> *mut sockaddr
fn as_sockaddr_mut(address: &mut MaybeUninit<Self>) -> *mut sockaddr
Get a mutable pointer to the socket address. Read more
Source§fn finalize(address: MaybeUninit<Self>, len: socklen_t) -> Result<Self>
fn finalize(address: MaybeUninit<Self>, len: socklen_t) -> Result<Self>
Finalize a socket address that has been written into by the kernel. Read more
Source§fn family(&self) -> sa_family_t
fn family(&self) -> sa_family_t
Get the address family of the socket address.
Source§impl Clone for Inet4SocketAddress
impl Clone for Inet4SocketAddress
Source§fn clone(&self) -> Inet4SocketAddress
fn clone(&self) -> Inet4SocketAddress
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 From<&Inet4SocketAddress> for SocketAddrV4
impl From<&Inet4SocketAddress> for SocketAddrV4
Source§fn from(other: &Inet4SocketAddress) -> Self
fn from(other: &Inet4SocketAddress) -> Self
Converts to this type from the input type.
Source§impl From<&Inet4SocketAddress> for SocketAddress
impl From<&Inet4SocketAddress> for SocketAddress
Source§fn from(other: &Inet4SocketAddress) -> Self
fn from(other: &Inet4SocketAddress) -> Self
Converts to this type from the input type.
Source§impl From<&SocketAddrV4> for Inet4SocketAddress
impl From<&SocketAddrV4> for Inet4SocketAddress
Source§fn from(other: &SocketAddrV4) -> Self
fn from(other: &SocketAddrV4) -> Self
Converts to this type from the input type.
Source§impl From<Inet4SocketAddress> for SocketAddrV4
impl From<Inet4SocketAddress> for SocketAddrV4
Source§fn from(other: Inet4SocketAddress) -> Self
fn from(other: Inet4SocketAddress) -> Self
Converts to this type from the input type.
Source§impl From<Inet4SocketAddress> for SocketAddress
impl From<Inet4SocketAddress> for SocketAddress
Source§fn from(other: Inet4SocketAddress) -> Self
fn from(other: Inet4SocketAddress) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddrV4> for Inet4SocketAddress
impl From<SocketAddrV4> for Inet4SocketAddress
Source§fn from(other: SocketAddrV4) -> Self
fn from(other: SocketAddrV4) -> Self
Converts to this type from the input type.
Source§impl SpecificSocketAddress for Inet4SocketAddress
impl SpecificSocketAddress for Inet4SocketAddress
Source§fn static_family() -> sa_family_t
fn static_family() -> sa_family_t
The address family supported by this socket address.
Auto Trait Implementations§
impl Freeze for Inet4SocketAddress
impl RefUnwindSafe for Inet4SocketAddress
impl Send for Inet4SocketAddress
impl Sync for Inet4SocketAddress
impl Unpin for Inet4SocketAddress
impl UnwindSafe for Inet4SocketAddress
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