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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.