pub struct UpstreamDescriptor { /* private fields */ }Expand description
The upstream target is a type that holds all the information to uniquely identify an upstream target.
Implementations§
Source§impl UpstreamDescriptor
impl UpstreamDescriptor
Sourcepub fn new<T>(host: T, port: u16, scheme: Scheme) -> Self
pub fn new<T>(host: T, port: u16, scheme: Scheme) -> Self
Manually constructs an upstream descriptor.
Sourcepub fn from_dsn(dsn: &Dsn) -> Self
pub fn from_dsn(dsn: &Dsn) -> Self
Given a DSN this returns an upstream descriptor that describes it.
Sourcepub fn socket_addr(self) -> Result<SocketAddr, UpstreamError>
pub fn socket_addr(self) -> Result<SocketAddr, UpstreamError>
Returns the socket address of the upstream.
This might perform a DSN lookup and could fail. Callers are encouraged this call this regularly as DNS might be used for load balancing purposes and results might expire.
Trait Implementations§
Source§impl Clone for UpstreamDescriptor
impl Clone for UpstreamDescriptor
Source§fn clone(&self) -> UpstreamDescriptor
fn clone(&self) -> UpstreamDescriptor
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 UpstreamDescriptor
impl Debug for UpstreamDescriptor
Source§impl Default for UpstreamDescriptor
impl Default for UpstreamDescriptor
Source§impl<'de> Deserialize<'de> for UpstreamDescriptor
impl<'de> Deserialize<'de> for UpstreamDescriptor
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 UpstreamDescriptor
impl Display for UpstreamDescriptor
Source§impl FromStr for UpstreamDescriptor
impl FromStr for UpstreamDescriptor
Source§impl Hash for UpstreamDescriptor
impl Hash for UpstreamDescriptor
Source§impl Ord for UpstreamDescriptor
impl Ord for UpstreamDescriptor
Source§fn cmp(&self, other: &UpstreamDescriptor) -> Ordering
fn cmp(&self, other: &UpstreamDescriptor) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for UpstreamDescriptor
impl PartialEq for UpstreamDescriptor
Source§impl PartialOrd for UpstreamDescriptor
impl PartialOrd for UpstreamDescriptor
Source§impl Serialize for UpstreamDescriptor
impl Serialize for UpstreamDescriptor
impl Eq for UpstreamDescriptor
impl StructuralPartialEq for UpstreamDescriptor
Auto Trait Implementations§
impl Freeze for UpstreamDescriptor
impl RefUnwindSafe for UpstreamDescriptor
impl Send for UpstreamDescriptor
impl Sync for UpstreamDescriptor
impl Unpin for UpstreamDescriptor
impl UnsafeUnpin for UpstreamDescriptor
impl UnwindSafe for UpstreamDescriptor
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.