Enum salvo_core::conn::addr::SocketAddr
source · #[non_exhaustive]pub enum SocketAddr {
Unknown,
IPv4(SocketAddrV4),
IPv6(SocketAddrV6),
Unix(Arc<SocketAddr>),
}
Expand description
Network socket address
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unknown
Unknown address
IPv4(SocketAddrV4)
IPv4 socket address
IPv6(SocketAddrV6)
IPv6 socket address
Unix(Arc<SocketAddr>)
Available on Unix only.
Unix socket address
Implementations§
source§impl SocketAddr
impl SocketAddr
sourcepub fn into_std(self) -> Option<SocketAddr>
pub fn into_std(self) -> Option<SocketAddr>
Convert to std::net::SocketAddr
.
sourcepub fn as_ipv6(&self) -> Option<&SocketAddrV6>
pub fn as_ipv6(&self) -> Option<&SocketAddrV6>
Returns ipv6 socket address.
sourcepub fn as_ipv4(&self) -> Option<&SocketAddrV4>
pub fn as_ipv4(&self) -> Option<&SocketAddrV4>
Returns ipv4 socket address.
sourcepub fn as_unix(&self) -> Option<&SocketAddr>
Available on Unix only.
pub fn as_unix(&self) -> Option<&SocketAddr>
Returns unix socket address.
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<Arc<SocketAddr>> for SocketAddr
impl From<Arc<SocketAddr>> for SocketAddr
source§fn from(addr: Arc<SocketAddr>) -> Self
fn from(addr: Arc<SocketAddr>) -> Self
Converts to this type from the input type.
source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrV4> for SocketAddr
impl From<SocketAddrV4> for SocketAddr
source§fn from(addr: SocketAddrV4) -> Self
fn from(addr: SocketAddrV4) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrV6> for SocketAddr
impl From<SocketAddrV6> for SocketAddr
source§fn from(addr: SocketAddrV6) -> Self
fn from(addr: SocketAddrV6) -> Self
Converts to this type from the input type.
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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