pub trait TcpConnector: Send + Sync {
type Stream: AsyncRead + AsyncWrite + Send + Unpin + 'static;
// Required method
fn connect(
&self,
addr: &str,
) -> impl Future<Output = Result<Self::Stream>> + Send;
}
Expand description
Trait for network types that can establish TCP connections.
Required Associated Types§
Required Methods§
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.