Skip to main content

StreamDialer

Trait StreamDialer 

Source
pub trait StreamDialer {
    type Stream: ByteStream + Send;

    // Required method
    fn connect<'a>(
        &'a self,
        host: &'a str,
        port: u16,
    ) -> impl Future<Output = TransportResult<Self::Stream>> + Send + 'a;
}
Expand description

Produces streams: the client side.

host is unresolved — name resolution belongs to the adapter, so a connector carries no resolver.

Required Associated Types§

Source

type Stream: ByteStream + Send

The stream this dialer produces.

Required Methods§

Source

fn connect<'a>( &'a self, host: &'a str, port: u16, ) -> impl Future<Output = TransportResult<Self::Stream>> + Send + 'a

Open a stream to host:port. host is either a hostname or an unbracketed IP literal.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§