pub trait AsyncStreamWriter {
// Required methods
fn write(&mut self, data: &[u8]) -> impl Future<Output = Result<()>>;
fn write_bytes(&mut self, data: Bytes) -> impl Future<Output = Result<()>>;
fn sync(&mut self) -> impl Future<Output = Result<()>>;
}
Expand description
A non seekable writer, e.g. a network socket.
Required Methods§
Sourcefn write(&mut self, data: &[u8]) -> impl Future<Output = Result<()>>
fn write(&mut self, data: &[u8]) -> impl Future<Output = Result<()>>
Write the entire slice.
In case of an error, some bytes may have been written.
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.