Trait 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 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
fn connect( &self, addr: SocketAddr, ) -> impl Future<Output = Result<TcpStream, Self::Error>> + Send
Connect to the target via the given SocketAddr
ess to establish a [TcpStream
].
Object Safety§
This trait is not object safe.