Skip to main content

WriteBytes

Trait WriteBytes 

Source
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(self) -> impl Future<Output = Result<u64, Error>> + Send;
    fn skip(
        &mut self,
        amount: u64,
    ) -> impl Future<Output = Result<(), Error>> + Send;
}
Expand description

This trait is an asynchronous streaming writer.

Required Methods§

Source

fn block_size(&self) -> u64

Source

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.

Source

fn complete(self) -> impl Future<Output = Result<u64, Error>> + Send

Called to flush to the handle. The total number of bytes written is returned.

Source

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.

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.

Implementors§