Skip to main content

Writer

Trait Writer 

Source
pub trait Writer:
    AsyncWrite
    + Unpin
    + Send {
    // Required methods
    fn tell<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<WriteResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait for writing to a file on local file system or object store.

Required Methods§

Source

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

Tell the current offset.

Source

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

Flush all buffered data and finalize the write, returning metadata about the written object.

Trait Implementations§

Source§

impl Writer for Box<dyn Writer>

Source§

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

Tell the current offset.
Source§

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

Flush all buffered data and finalize the write, returning metadata about the written object.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Writer for Box<dyn Writer>

Source§

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

Source§

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

Source§

impl Writer for File

Source§

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

Source§

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

Implementors§