Enum pingora_core::protocols::l4::socket::SocketAddr
source · 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
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl ToSocketAddrs for SocketAddr
impl ToSocketAddrs for SocketAddr
§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
SocketAddrs. 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<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§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.