Skip to main content

StreamProvider

Trait StreamProvider 

Source
pub trait StreamProvider {
    type Item: NetworkStream;

    // Required method
    fn from_addr<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 from_addr<A: ToSocketAddrs + Send>( addr: A, ) -> impl Future<Output = Result<Self::Item, Error>> + Send

Create a stream from a socket address or hostname.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§