Struct hyper_srv::ServiceConnector
source · pub struct ServiceConnector<C> { /* private fields */ }
Expand description
A wrapper around Hyper’s Connect
or with ability to preresolve SRV DNS records
before supplying resulting host:port
pair to the underlying connector.
Implementations§
source§impl<C> ServiceConnector<C>
impl<C> ServiceConnector<C>
sourcepub fn new(inner: C, resolver: Option<TokioAsyncResolver>) -> Self
pub fn new(inner: C, resolver: Option<TokioAsyncResolver>) -> Self
Creates a new instance of ServiceConnector
with provided connector and
optional DNS resolver. If the resolver is set to None all connections will be
handled directly by the underlying connector. This allows to toggle SRV resolving
mechanism without changing a type of connector used
in a client (as it must be named and can not even be made into a trait object).
Trait Implementations§
source§impl<C: Clone> Clone for ServiceConnector<C>
impl<C: Clone> Clone for ServiceConnector<C>
source§fn clone(&self) -> ServiceConnector<C>
fn clone(&self) -> ServiceConnector<C>
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<C: Debug> Debug for ServiceConnector<C>
impl<C: Debug> Debug for ServiceConnector<C>
source§impl<C> Service<Uri> for ServiceConnector<C>
impl<C> Service<Uri> for ServiceConnector<C>
§type Error = ServiceError
type Error = ServiceError
Errors produced by the service.
§type Future = ServiceConnecting<C>
type Future = ServiceConnecting<C>
The future response value.
Auto Trait Implementations§
impl<C> !RefUnwindSafe for ServiceConnector<C>
impl<C> Send for ServiceConnector<C>where
C: Send,
impl<C> Sync for ServiceConnector<C>where
C: Sync,
impl<C> Unpin for ServiceConnector<C>where
C: Unpin,
impl<C> !UnwindSafe for ServiceConnector<C>
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