[−][src]Struct posix_socket::SocketAddress
Generic socket address, large enough to hold any valid address.
Implementations
impl SocketAddress
[src]
pub fn from_raw(inner: sockaddr_storage, len: socklen_t) -> Self
[src]
Create a SocketAddress
from a libc::sockaddr_storage
and a length.
pub fn from_other<Address: AsSocketAddress>(other: &Address) -> Self
[src]
Create a generic SocketAddress
by copying data from another address.
pub fn into_raw(self) -> (sockaddr_storage, socklen_t)
[src]
Convert the SocketAddress
into raw libc
parts.
pub fn family(&self) -> c_int
[src]
Get the address family.
pub fn as_inet4(&self) -> Option<Inet4SocketAddress>
[src]
Get the address as an IPv4 socket address.
Returns None
if the address is not an IPv4 socket address.
pub fn as_inet6(&self) -> Option<Inet6SocketAddress>
[src]
Get the address as an IPv6 socket address.
Returns None
if the address is not an IPv6 socket address.
pub fn as_unix(&self) -> Option<UnixSocketAddress>
[src]
Get the address as an unix socket address.
Returns None
if the address is not a unix socket address.
Trait Implementations
impl AsSocketAddress for SocketAddress
[src]
fn as_sockaddr(&self) -> *const sockaddr
[src]
fn as_sockaddr_mut(address: &mut MaybeUninit<Self>) -> *mut sockaddr
[src]
fn len(&self) -> socklen_t
[src]
fn finalize(address: MaybeUninit<Self>, len: socklen_t) -> Result<Self>
[src]
fn max_len() -> socklen_t
[src]
fn family(&self) -> sa_family_t
[src]
impl Clone for SocketAddress
[src]
fn clone(&self) -> SocketAddress
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_> From<&'_ Inet4SocketAddress> for SocketAddress
[src]
fn from(other: &Inet4SocketAddress) -> Self
[src]
impl<'_> From<&'_ Inet6SocketAddress> for SocketAddress
[src]
fn from(other: &Inet6SocketAddress) -> Self
[src]
impl<'_> From<&'_ UnixSocketAddress> for SocketAddress
[src]
fn from(other: &UnixSocketAddress) -> Self
[src]
impl From<Inet4SocketAddress> for SocketAddress
[src]
fn from(other: Inet4SocketAddress) -> Self
[src]
impl From<Inet6SocketAddress> for SocketAddress
[src]
fn from(other: Inet6SocketAddress) -> Self
[src]
impl From<UnixSocketAddress> for SocketAddress
[src]
fn from(other: UnixSocketAddress) -> Self
[src]
impl GenericSocketAddress for SocketAddress
[src]
Auto Trait Implementations
impl RefUnwindSafe for SocketAddress
impl Send for SocketAddress
impl Sync for SocketAddress
impl Unpin for SocketAddress
impl UnwindSafe for SocketAddress
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,