pub enum ResolvableSocketAddr {
UnixDomain(Box<SocketAddr>),
V4(Box<SocketAddrV4>),
V6(Box<SocketAddrV6>),
Hostname {
host: String,
port: u16,
},
}Expand description
An address that can be resolved to one or more concrete socket addresses.
Unlike SocketAddress, the Hostname arm accepts a DNS name plus a
required port; resolution to a concrete IP requires a DNS lookup, which
is performed by dns_resolver::resolve_socket_addr.
Variants§
UnixDomain(Box<SocketAddr>)
V4(Box<SocketAddrV4>)
V6(Box<SocketAddrV6>)
Hostname
A DNS name plus a required port. The host is stored verbatim (no IDNA normalization), but has been validated as a syntactically well-formed DNS name at construction time.
Implementations§
Trait Implementations§
Source§impl Clone for ResolvableSocketAddr
impl Clone for ResolvableSocketAddr
Source§fn clone(&self) -> ResolvableSocketAddr
fn clone(&self) -> ResolvableSocketAddr
Returns a duplicate 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 ResolvableSocketAddr
impl Debug for ResolvableSocketAddr
Source§impl<'de> Deserialize<'de> for ResolvableSocketAddr
impl<'de> Deserialize<'de> for ResolvableSocketAddr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ResolvableSocketAddr
impl Display for ResolvableSocketAddr
Source§impl From<ResolvableSocketAddr> for String
impl From<ResolvableSocketAddr> for String
Source§fn from(a: ResolvableSocketAddr) -> String
fn from(a: ResolvableSocketAddr) -> String
Converts to this type from the input type.
Source§impl From<SocketAddr> for ResolvableSocketAddr
impl From<SocketAddr> for ResolvableSocketAddr
Source§fn from(unix: UnixSocketAddr) -> Self
fn from(unix: UnixSocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for ResolvableSocketAddr
impl From<SocketAddr> for ResolvableSocketAddr
Source§impl From<SocketAddr> for ResolvableSocketAddr
impl From<SocketAddr> for ResolvableSocketAddr
Source§fn from(a: SocketAddr) -> Self
fn from(a: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddrV4> for ResolvableSocketAddr
impl From<SocketAddrV4> for ResolvableSocketAddr
Source§fn from(a: SocketAddrV4) -> Self
fn from(a: SocketAddrV4) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddrV6> for ResolvableSocketAddr
impl From<SocketAddrV6> for ResolvableSocketAddr
Source§fn from(a: SocketAddrV6) -> Self
fn from(a: SocketAddrV6) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddress> for ResolvableSocketAddr
impl From<SocketAddress> for ResolvableSocketAddr
Source§fn from(a: SocketAddress) -> Self
fn from(a: SocketAddress) -> Self
Converts to this type from the input type.
Source§impl FromStr for ResolvableSocketAddr
impl FromStr for ResolvableSocketAddr
Source§impl PartialEq for ResolvableSocketAddr
impl PartialEq for ResolvableSocketAddr
Source§impl Serialize for ResolvableSocketAddr
impl Serialize for ResolvableSocketAddr
Source§impl TryFrom<String> for ResolvableSocketAddr
impl TryFrom<String> for ResolvableSocketAddr
impl Eq for ResolvableSocketAddr
Auto Trait Implementations§
impl Freeze for ResolvableSocketAddr
impl RefUnwindSafe for ResolvableSocketAddr
impl Send for ResolvableSocketAddr
impl Sync for ResolvableSocketAddr
impl Unpin for ResolvableSocketAddr
impl UnwindSafe for ResolvableSocketAddr
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more