pub trait StreamProvider {
    type Item: NetworkStream;

    // Required method
    fn connect<A: ToSocketAddrs + Send>(
        addr: A
    ) -> impl Future<Output = Result<Self::Item, Error>> + Send;
}
Expand description

Provides an abstraction for connect

Required Associated Types§

source

type Item: NetworkStream

Stream obtained after connect

Required Methods§

source

fn connect<A: ToSocketAddrs + Send>( addr: A ) -> impl Future<Output = Result<Self::Item, Error>> + Send

Getting the Stream through a connection, the only difference between this process and tokio::net::TcpStream::connect is that it will be resolved through a customized dns service

Object Safety§

This trait is not object safe.

Implementors§