[][src]Struct hyper_srv::ServiceConnector

pub struct ServiceConnector<C> { /* fields omitted */ }

A wrapper around Hyper's Connector with ability to preresolve SRV DNS records before supplying resulting host:port pair to the underlying connector.

Methods

impl<C> ServiceConnector<C>[src]

pub fn new(inner: C, resolver: Option<AsyncResolver>) -> Self[src]

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

impl<C: Clone> Clone for ServiceConnector<C>[src]

impl<C: Debug> Debug for ServiceConnector<C>[src]

impl<C> Service<Uri> for ServiceConnector<C> where
    C: Service<Uri> + Clone + Unpin,
    C::Response: AsyncRead + AsyncWrite + Connection + Unpin + Send + 'static,
    C::Error: Into<Box<dyn Error + Send + Sync>>,
    C::Future: Unpin + Send
[src]

type Response = C::Response

Responses given by the service.

type Error = ServiceError

Errors produced by the service.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,