[][src]Struct tower_h2::client::Connect

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

Establishes an H2 client connection.

Has a builder-like API for configuring client connections. Currently this only allows the configuration of TLS transport on new services created by this factory.

Methods

impl<A, C, E, S> Connect<A, C, E, S> where
    C: MakeConnection<A>,
    E: Executor<Background<C::Connection, S>> + Clone,
    S: Body,
    S::Data: 'static,
    S::Error: Into<Box<dyn Error>>, 
[src]

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

Create a new Connect.

The connect argument is used to obtain new session layer instances (AsyncRead + AsyncWrite). For each new client service returned, a task will be spawned onto executor that will be used to manage the H2 connection.

Trait Implementations

impl<A, C, E, S> Service<A> for Connect<A, C, E, S> where
    C: MakeConnection<A> + 'static,
    E: Executor<Background<C::Connection, S>> + Clone,
    S: Body + 'static,
    S::Error: Into<Box<dyn Error>>, 
[src]

type Response = Connection<C::Connection, E, S>

Responses given by the service.

type Error = ConnectError<C::Error>

Errors produced by the service.

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

The future response value.

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, C, E, S> Send for Connect<A, C, E, S> where
    A: Send,
    C: Send,
    E: Send,
    S: Send

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

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Erased for T

impl<T, Request> ServiceExt for T where
    T: Service<Request> + ?Sized
[src]

fn ready(self) -> Ready<Self, Request>[src]

A future yielding the service when it is ready to accept a request.

fn oneshot(self, req: Request) -> Oneshot<Self, Request>[src]

Consume this Service, calling with the providing request once it is ready.

fn call_all<S>(self, reqs: S) -> CallAll<Self, S> where
    S: Stream<Item = Request>,
    Self::Error: Into<Box<dyn Error + 'static + Send + Sync>>,
    <S as Stream>::Error: Into<Box<dyn Error + 'static + Send + Sync>>, 
[src]

Process all requests from the given Stream, and produce a Stream of their responses. Read more

impl<M, S, Target, Request> MakeService 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.