pub trait AsyncStream:
AsyncRead
+ AsyncWrite
+ Unpin
+ Send { }Expand description
Supertrait that bundles the async IO bounds we need for an erased stream.
Rust trait objects only allow one non-auto trait, so we cannot write
Box<dyn AsyncRead + AsyncWrite + …>. This supertrait collapses the
bounds into a single name that is trait-object-compatible.
The blanket impl covers every concrete stream type we care about
(TcpStream, TlsStream<TcpStream>), so wrapping is a zero-cost
Box::new(stream).