[][src]Trait hyper::client::connect::Connect

pub trait Connect: Send + Sync {
    type Transport: AsyncRead + AsyncWrite + Unpin + Send + 'static;
    type Error: Into<Box<dyn StdError + Send + Sync>>;
    type Future: Future<Output = Result<(Self::Transport, Connected), Self::Error>> + Unpin + Send;
    fn connect(&self, dst: Destination) -> Self::Future;
}

Connect to a destination, returning an IO transport.

A connector receives a Destination describing how a connection should be estabilished, and returns a Future of the ready connection.

Associated Types

type Transport: AsyncRead + AsyncWrite + Unpin + Send + 'static

The connected IO Stream.

type Error: Into<Box<dyn StdError + Send + Sync>>

An error occured when trying to connect.

type Future: Future<Output = Result<(Self::Transport, Connected), Self::Error>> + Unpin + Send

A Future that will resolve to the connected Transport.

Loading content...

Required methods

fn connect(&self, dst: Destination) -> Self::Future

Connect to a destination.

Loading content...

Implementations on Foreign Types

impl<T: Connect + ?Sized> Connect for Box<T>[src]

type Transport = <T as Connect>::Transport

type Error = <T as Connect>::Error

type Future = <T as Connect>::Future

Loading content...

Implementors

impl<R> Connect for HttpConnector<R> where
    R: Resolve + Clone + Send + Sync,
    R::Future: Send
[src]

type Transport = TcpStream

type Error = Error

type Future = HttpConnecting<R>

Loading content...