Trait tower::make::MakeConnection[][src]

pub trait MakeConnection<Target>: Sealed<(Target,)> {
    type Connection: AsyncRead + AsyncWrite;
    type Error;
    type Future: Future<Output = Result<Self::Connection, Self::Error>>;
    fn poll_ready(
        &mut self,
        cx: &mut Context<'_>
    ) -> Poll<Result<(), Self::Error>>;
fn make_connection(&mut self, target: Target) -> Self::Future; }
This is supported on crate feature make only.

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[src]

The transport provided by this service

type Error[src]

Errors produced by the connecting service

type Future: Future<Output = Result<Self::Connection, Self::Error>>[src]

The future that eventually produces the transport

Loading content...

Required methods

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>[src]

Returns Poll::Ready(Ok(())) when it is able to make more connections.

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

Connect and return a transport asynchronously

Loading content...

Implementors

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

type Connection = C::Response

type Error = C::Error

type Future = C::Future

Loading content...