Trait Write
pub trait Write:
Unpin
+ Send
+ Sync {
// Required methods
fn write(
&mut self,
bs: Buffer,
) -> impl Future<Output = Result<(), Error>> + MaybeSend;
fn close(
&mut self,
) -> impl Future<Output = Result<Metadata, Error>> + MaybeSend;
fn abort(&mut self) -> impl Future<Output = Result<(), Error>> + MaybeSend;
// Provided method
fn copy_from(
&mut self,
_path: &str,
_args: OpRead,
_range: BytesRange,
) -> impl Future<Output = Result<(), Error>> + MaybeSend { ... }
}Expand description
Write is the async sink used by services and layers.
Required Methods§
fn write(
&mut self,
bs: Buffer,
) -> impl Future<Output = Result<(), Error>> + MaybeSend
fn write( &mut self, bs: Buffer, ) -> impl Future<Output = Result<(), Error>> + 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.
Provided Methods§
fn copy_from(
&mut self,
_path: &str,
_args: OpRead,
_range: BytesRange,
) -> impl Future<Output = Result<(), Error>> + MaybeSend
fn copy_from( &mut self, _path: &str, _args: OpRead, _range: BytesRange, ) -> impl Future<Output = Result<(), Error>> + MaybeSend
Copy one absolute bounded source range into this writer.
Callers invoke this operation only when the composed service declares
Capability::write_can_copy_from. Every error is an execution failure
and must not trigger streaming fallback.
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.