pub trait Write:
Unpin
+ Send
+ Sync {
// Required methods
fn write(
&mut self,
bs: Buffer,
) -> impl Future<Output = Result<()>> + MaybeSend;
fn close(&mut self) -> impl Future<Output = Result<Metadata>> + MaybeSend;
fn abort(&mut self) -> impl Future<Output = Result<()>> + MaybeSend;
}Expand description
Write is the async sink used by services and layers.
Required Methods§
Sourcefn write(&mut self, bs: Buffer) -> impl Future<Output = Result<()>> + MaybeSend
fn write(&mut self, bs: Buffer) -> impl Future<Output = Result<()>> + MaybeSend
Write the entire buffer into the writer.
Ok(()) means all bytes from bs have been accepted. Implementations
must return an error instead of treating a partial write as success.
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.