[][src]Trait tower::MakeConnection

pub trait MakeConnection<Target>: Sealed<(Target,)> where
    <Self::Future as Future>::Item == Self::Connection,
    <Self::Future as Future>::Error == Self::Error
{ type Connection: AsyncRead + AsyncWrite; type Error; type Future: Future; fn poll_ready(&mut self) -> Result<Async<()>, Self::Error>;
fn make_connection(&mut self, target: Target) -> Self::Future; }

The MakeConnection trait is used to create transports

The goal of this service is to allow composable methods for creating AsyncRead + AsyncWrite transports. This could mean creating a TLS based connection or using some other method to authenticate the connection.

Associated Types

type Connection: AsyncRead + AsyncWrite

The transport provided by this service

type Error

Errors produced by the connecting service

type Future: Future

The future that eventually produces the transport

Loading content...

Required methods

fn poll_ready(&mut self) -> Result<Async<()>, Self::Error>

Returns Ready when it is able to make more connections.

fn make_connection(&mut self, target: Target) -> Self::Future

Connect and return a transport asynchronously

Loading content...

Implementors

impl<C, Target> MakeConnection<Target> for C where
    C: Service<Target>,
    <C as Service<Target>>::Response: AsyncRead,
    <C as Service<Target>>::Response: AsyncWrite
[src]

type Connection = <C as Service<Target>>::Response

type Error = <C as Service<Target>>::Error

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

Loading content...