Trait iceberg::io::FileWrite

source ·
pub trait FileWrite: Send + Unpin + 'static {
    // Required methods
    fn write<'life0, 'async_trait>(
        &'life0 mut self,
        bs: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for writing file.

§TODO

It’s possible for us to remove the async_trait, but we need to figure out how to handle the object safety.

Required Methods§

source

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

Write bytes to file.

TODO: we can support writing non-contiguous bytes in the future.

source

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

Close file.

Calling close on closed file will generate an error.

Implementations on Foreign Types§

source§

impl FileWrite for Writer

source§

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

source§

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

Implementors§