pub trait WriteBytes: Sized {
// Required methods
fn block_size(&self) -> u64;
fn write_bytes(
&mut self,
buf: &[u8],
) -> impl Future<Output = Result<(), Error>> + Send;
fn complete(&mut self) -> impl Future<Output = Result<(), Error>> + Send;
fn skip(
&mut self,
amount: u64,
) -> impl Future<Output = Result<(), Error>> + Send;
fn bytes_written(&self) -> u64;
}Expand description
This trait is an asynchronous streaming writer.
Required Methods§
fn block_size(&self) -> u64
Sourcefn write_bytes(
&mut self,
buf: &[u8],
) -> impl Future<Output = Result<(), Error>> + Send
fn write_bytes( &mut self, buf: &[u8], ) -> impl Future<Output = Result<(), Error>> + Send
Buffers writes to be written to the underlying handle. This may flush bytes immediately or when buffers are full.
Sourcefn complete(&mut self) -> impl Future<Output = Result<(), Error>> + Send
fn complete(&mut self) -> impl Future<Output = Result<(), Error>> + Send
Called to flush to the handle. Named to avoid conflict with the flush method above.
Sourcefn skip(
&mut self,
amount: u64,
) -> impl Future<Output = Result<(), Error>> + Send
fn skip( &mut self, amount: u64, ) -> impl Future<Output = Result<(), Error>> + Send
Moves the offset forward by amount, which will result in zeroes in the output stream, even
if no other data is appended to it.
Sourcefn bytes_written(&self) -> u64
fn bytes_written(&self) -> u64
Returns the total bytes written to the writer.
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.