pub trait WriteBytes {
    // Required methods
    fn handle(&self) -> &dyn WriteObjectHandle;
    fn write_bytes<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        buf: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn complete<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn skip<'life0, 'async_trait>(
        &'life0 mut self,
        amount: u64
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

This trait is an asynchronous streaming writer.

Required Methods§

source

fn handle(&self) -> &dyn WriteObjectHandle

source

fn write_bytes<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Buffers writes to be written to the underlying handle. This may flush bytes immediately or when buffers are full.

source

fn complete<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Called to flush to the handle. Named to avoid confluct with the flush method above.

source

fn skip<'life0, 'async_trait>( &'life0 mut self, amount: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Moves the offset forward by amount, which will result in zeroes in the output stream, even if no other data is appended to it.

Implementors§