pub trait Socket: Send + 'static {
// Required methods
fn read(&mut self) -> impl Future<Output = Option<Bytes>> + Send;
fn write(
&mut self,
buffer: &[u8],
) -> impl Future<Output = Result<()>> + Send;
fn close(&mut self) -> impl Future<Output = ()> + Send;
}Required Methods§
fn read(&mut self) -> impl Future<Output = Option<Bytes>> + Send
fn write(&mut self, buffer: &[u8]) -> impl Future<Output = Result<()>> + Send
fn close(&mut self) -> impl Future<Output = ()> + Send
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.