[][src]Struct tower_hyper::Connect

pub struct Connect<A, B, C, E> { /* fields omitted */ }

Creates a hyper connection

This accepts a hyper::client::conn::Builder and provides a MakeService implementation to create connections from some target A

Methods

impl<A, B, C> Connect<A, B, C, DefaultExecutor> where
    C: HttpMakeConnection<A>,
    B: HttpBody,
    C::Connection: Send + 'static, 
[src]

pub fn new(inner: C) -> Self[src]

Create a new Connect.

The C argument is used to obtain new session layer instances (AsyncRead + AsyncWrite). For each new client service returned, a Service is returned that can be driven by poll_service and to send requests via call.

pub fn with_builder(inner: C, builder: Builder) -> Self[src]

Create a new Connect with a builder.

impl<A, B, C, E> Connect<A, B, C, E> where
    C: HttpMakeConnection<A>,
    B: HttpBody,
    C::Connection: Send + 'static, 
[src]

pub fn with_executor(inner: C, builder: Builder, exec: E) -> Self[src]

Create a new Connect.

The C argument is used to obtain new session layer instances (AsyncRead + AsyncWrite). For each new client service returned, a Service is returned that can be driven by poll_service and to send requests via call.

The E argument is the executor that the background task for the connection will be spawned on.

Trait Implementations

impl<A: Debug, B: Debug, C: Debug, E: Debug> Debug for Connect<A, B, C, E>[src]

impl<A, B, C, E> Service<A> for Connect<A, B, C, E> where
    C: HttpMakeConnection<A> + 'static,
    B: HttpBody + Send + 'static,
    B::Data: Send,
    B::Error: Into<Box<dyn Error + Send + Sync>>,
    C::Connection: Send + 'static,
    E: ConnectExecutor<C::Connection, B> + Clone
[src]

type Response = Connection<B>

Responses given by the service.

type Error = ConnectError<C::Error>

Errors produced by the service.

type Future = ConnectFuture<A, B, C, E>

The future response value.

fn poll_ready(&mut self) -> Poll<(), Self::Error>[src]

Check if the MakeConnection is ready for a new connection.

fn call(&mut self, target: A) -> Self::Future[src]

Obtains a Connection on a single plaintext h2 connection to a remote.

Auto Trait Implementations

impl<A, B, C, E> Sync for Connect<A, B, C, E> where
    A: Sync,
    B: Sync,
    C: Sync,
    E: Sync

impl<A, B, C, E> Send for Connect<A, B, C, E> where
    A: Send,
    B: Send,
    C: Send,
    E: Send

impl<A, B, C, E> Unpin for Connect<A, B, C, E> where
    A: Unpin,
    B: Unpin,
    C: Unpin,
    E: Unpin

impl<A, B, C, E> !RefUnwindSafe for Connect<A, B, C, E>

impl<A, B, C, E> !UnwindSafe for Connect<A, B, C, E>

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<M, S, Target, Request> MakeService<Target, Request> for M where
    M: Service<Target, Response = S>,
    S: Service<Request>, 
[src]

type Response = <S as Service<Request>>::Response

Responses given by the service

type Error = <S as Service<Request>>::Error

Errors produced by the service

type Service = S

The Service value created by this factory

type MakeError = <M as Service<Target>>::Error

Errors produced while building a service.

type Future = <M as Service<Target>>::Future

The future of the Service instance.