Struct quilkin::endpoint::EndpointAddress
source · [−]Expand description
A valid socket address. This differs from std::net::SocketAddr
, in that it
it supports parsing Domain Names in addition to IP addresses. Domain Names
are resolved when ToSocketAddrs::to_socket_addrs
is called.
Fields
host: AddressKind
A valid name or IP address that resolves to a address.
port: Option<u16>
The port of the socket address, if present.
Implementations
sourceimpl EndpointAddress
impl EndpointAddress
pub const UNSPECIFIED: Self = _
pub const LOCALHOST: Self = _
sourceimpl EndpointAddress
impl EndpointAddress
sourcepub fn port(&self) -> u16
pub fn port(&self) -> u16
Returns the port for the endpoint address, or 0
if no port
was specified.
sourcepub fn to_socket_addr(&self) -> Result<SocketAddr, ToSocketAddrError>
pub fn to_socket_addr(&self) -> Result<SocketAddr, ToSocketAddrError>
Returns the socket address for the endpoint, resolving any DNS entries if present.
Trait Implementations
sourceimpl Clone for EndpointAddress
impl Clone for EndpointAddress
sourcefn clone(&self) -> EndpointAddress
fn clone(&self) -> EndpointAddress
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for EndpointAddress
impl Debug for EndpointAddress
sourceimpl<'de> Deserialize<'de> for EndpointAddress
impl<'de> Deserialize<'de> for EndpointAddress
sourcefn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for EndpointAddress
impl Display for EndpointAddress
sourceimpl From<(IpAddr, u16)> for EndpointAddress
impl From<(IpAddr, u16)> for EndpointAddress
sourceimpl From<(Ipv4Addr, u16)> for EndpointAddress
impl From<(Ipv4Addr, u16)> for EndpointAddress
sourceimpl From<(Ipv6Addr, u16)> for EndpointAddress
impl From<(Ipv6Addr, u16)> for EndpointAddress
sourceimpl From<(String, u16)> for EndpointAddress
impl From<(String, u16)> for EndpointAddress
sourceimpl From<EndpointAddress> for Address
impl From<EndpointAddress> for Address
sourcefn from(address: EndpointAddress) -> Self
fn from(address: EndpointAddress) -> Self
Converts to this type from the input type.
sourceimpl From<EndpointAddress> for EnvoyAddress
impl From<EndpointAddress> for EnvoyAddress
sourcefn from(address: EndpointAddress) -> Self
fn from(address: EndpointAddress) -> Self
Converts to this type from the input type.
sourceimpl From<EndpointAddress> for EnvoySocketAddress
impl From<EndpointAddress> for EnvoySocketAddress
sourcefn from(address: EndpointAddress) -> Self
fn from(address: EndpointAddress) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddr> for EndpointAddress
impl From<SocketAddr> for EndpointAddress
sourcefn from(socket: SocketAddr) -> Self
fn from(socket: SocketAddr) -> Self
Converts to this type from the input type.
sourceimpl FromStr for EndpointAddress
impl FromStr for EndpointAddress
Forwards the deserialisation to use std::net::ToSocketAddrs
instead of
FromStr
for validation which allows us to resolve DNS hostnames such as
localhost
or container network names at parse-time.
sourceimpl Hash for EndpointAddress
impl Hash for EndpointAddress
sourceimpl Ord for EndpointAddress
impl Ord for EndpointAddress
sourcefn cmp(&self, other: &EndpointAddress) -> Ordering
fn cmp(&self, other: &EndpointAddress) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<EndpointAddress> for Endpoint
impl PartialEq<EndpointAddress> for Endpoint
sourcefn eq(&self, rhs: &EndpointAddress) -> bool
fn eq(&self, rhs: &EndpointAddress) -> bool
sourceimpl PartialEq<EndpointAddress> for EndpointAddress
impl PartialEq<EndpointAddress> for EndpointAddress
sourcefn eq(&self, other: &EndpointAddress) -> bool
fn eq(&self, other: &EndpointAddress) -> bool
sourceimpl PartialOrd<EndpointAddress> for EndpointAddress
impl PartialOrd<EndpointAddress> for EndpointAddress
sourcefn partial_cmp(&self, other: &EndpointAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &EndpointAddress) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl Serialize for EndpointAddress
impl Serialize for EndpointAddress
sourceimpl ToSocketAddrs for EndpointAddress
impl ToSocketAddrs for EndpointAddress
type Iter = <SocketAddr as ToSocketAddrs>::Iter
type Iter = <SocketAddr as ToSocketAddrs>::Iter
Returned iterator over socket addresses which this type may correspond
to. Read more
sourcefn 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 moresourceimpl TryFrom<Address> for EndpointAddress
impl TryFrom<Address> for EndpointAddress
sourceimpl TryFrom<Address> for EndpointAddress
impl TryFrom<Address> for EndpointAddress
sourceimpl TryFrom<Endpoint> for EndpointAddress
impl TryFrom<Endpoint> for EndpointAddress
sourceimpl TryFrom<SocketAddress> for EndpointAddress
impl TryFrom<SocketAddress> for EndpointAddress
impl Eq for EndpointAddress
impl StructuralEq for EndpointAddress
impl StructuralPartialEq for EndpointAddress
Auto Trait Implementations
impl RefUnwindSafe for EndpointAddress
impl Send for EndpointAddress
impl Sync for EndpointAddress
impl Unpin for EndpointAddress
impl UnwindSafe for EndpointAddress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request