pub trait StreamConnector: Debug {
type Stream: AsyncRead + AsyncWrite + Send + Unpin + 'static;
// Required method
fn connect_stream(
&self,
stream: TcpStream,
) -> impl Future<Output = Result<Self::Stream>> + Send;
}Expand description
An async handshake that provides an AsyndRead/AsyncWrite stream.
You could consider wrapping these if you need to hook stream connection, or of course you can implement your own connector for your own stream type.
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.