pub trait Streamable {
// Required method
fn read<T>(stream: &mut T) -> impl Future<Output = Result<Self>> + Send
where Self: Sized,
T: AsyncReadExt + Unpin + Send;
// Provided method
fn write<T>(
&self,
stream: &mut T,
) -> impl Future<Output = Result<()>> + Send
where Self: ToBytes + Send + Sync,
T: AsyncWriteExt + Unpin + Send { ... }
}Required Methods§
Provided 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.