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;
}Available on crate feature
tcp only.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 SocketAddress to establish a TcpStream.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
§impl TcpStreamConnector for ()
impl TcpStreamConnector for ()
Implementors§
§impl TcpStreamConnector for Arc<SocketOptions>
impl TcpStreamConnector for Arc<SocketOptions>
§impl TcpStreamConnector for DenyTcpStreamConnector
impl TcpStreamConnector for DenyTcpStreamConnector
type Error = TcpConnectDeniedError
§impl TcpStreamConnector for DeviceName
Available on Android or Fuchsia or Linux only.
impl TcpStreamConnector for DeviceName
Available on Android or Fuchsia or Linux only.