pub enum SocketAddr {
Inet(SocketAddr),
Unix(SocketAddr),
}
Expand description
SocketAddr
is a storage type that contains either a Internet (IP address)
socket address or a Unix domain socket address.
Variants§
Inet(SocketAddr)
Unix(SocketAddr)
Implementations§
Source§impl SocketAddr
impl SocketAddr
Sourcepub fn as_inet(&self) -> Option<&StdSockAddr>
pub fn as_inet(&self) -> Option<&StdSockAddr>
Get a reference to the IP socket if it is one
Sourcepub fn as_unix(&self) -> Option<&StdUnixSockAddr>
pub fn as_unix(&self) -> Option<&StdUnixSockAddr>
Get a reference to the Unix domain socket if it is one
pub fn from_raw_fd(fd: RawFd, peer_addr: bool) -> Option<SocketAddr>
Trait Implementations§
Source§impl Clone for SocketAddr
impl Clone for SocketAddr
Source§fn clone(&self) -> SocketAddr
fn clone(&self) -> SocketAddr
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 SocketAddr
impl Debug for SocketAddr
Source§impl Display for SocketAddr
impl Display for SocketAddr
Source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
Source§fn from(sockaddr: StdSockAddr) -> Self
fn from(sockaddr: StdSockAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
Source§fn from(sockaddr: StdUnixSockAddr) -> Self
fn from(sockaddr: StdUnixSockAddr) -> Self
Converts to this type from the input type.
Source§impl FromStr for SocketAddr
impl FromStr for SocketAddr
Source§impl Hash for SocketAddr
impl Hash for SocketAddr
Source§impl Ord for SocketAddr
impl Ord for SocketAddr
Source§impl PartialEq for SocketAddr
impl PartialEq for SocketAddr
Source§impl PartialOrd for SocketAddr
impl PartialOrd for SocketAddr
Source§impl ToSocketAddrs for SocketAddr
impl ToSocketAddrs for SocketAddr
Source§type Iter = Once<SocketAddr>
type Iter = Once<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreSource§impl TryFrom<SocketAddr> for SocketAddr
impl TryFrom<SocketAddr> for SocketAddr
impl Eq for SocketAddr
Auto Trait Implementations§
impl Freeze for SocketAddr
impl RefUnwindSafe for SocketAddr
impl Send for SocketAddr
impl Sync for SocketAddr
impl Unpin for SocketAddr
impl UnwindSafe for SocketAddr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.