Trait rama::tcp::client::TcpStreamConnector

pub trait TcpStreamConnector:
    Clone
    + Send
    + Sync
    + 'static {
    type Error;

    // Required method
    fn connect(
        &self,
        addr: SocketAddr,
    ) -> impl Future<Output = Result<TcpStream, Self::Error>> + Send;
}
Expand description

Trait used internally by tcp_connect and the TcpConnector to actually establish the [TcpStream.]

Required Associated Types§

type Error

Type of error that can occurr when establishing the connection failed.

Required Methods§

fn connect( &self, addr: SocketAddr, ) -> impl Future<Output = Result<TcpStream, Self::Error>> + Send

Connect to the target via the given SocketAddress to establish a [TcpStream].

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl TcpStreamConnector for ()

§

type Error = Error

§

fn connect( &self, addr: SocketAddr, ) -> impl Future<Output = Result<TcpStream, <() as TcpStreamConnector>::Error>> + Send

§

impl<T> TcpStreamConnector for Arc<T>

§

type Error = <T as TcpStreamConnector>::Error

§

fn connect( &self, addr: SocketAddr, ) -> impl Future<Output = Result<TcpStream, <Arc<T> as TcpStreamConnector>::Error>> + Send

Implementors§

§

impl<A, B> TcpStreamConnector for Either<A, B>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C> TcpStreamConnector for Either3<A, B, C>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D> TcpStreamConnector for Either4<A, B, C, D>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E> TcpStreamConnector for Either5<A, B, C, D, E>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F> TcpStreamConnector for Either6<A, B, C, D, E, F>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G> TcpStreamConnector for Either7<A, B, C, D, E, F, G>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G, H> TcpStreamConnector for Either8<A, B, C, D, E, F, G, H>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G, H, I> TcpStreamConnector for Either9<A, B, C, D, E, F, G, H, I>

§

type Error = Box<dyn Error + Sync + Send>

§

impl<ConnectFn, ConnectFnFut, ConnectFnErr> TcpStreamConnector for ConnectFn
where ConnectFn: FnOnce(SocketAddr) -> ConnectFnFut + Clone + Send + Sync + 'static, ConnectFnFut: Future<Output = Result<TcpStream, ConnectFnErr>> + Send + 'static, ConnectFnErr: Into<Box<dyn Error + Sync + Send>> + Send + 'static,

§

type Error = ConnectFnErr