Trait opendal::raw::oio::Write

source ·
pub trait Write: Unpin + Send + Sync {
    // 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 append<'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

Write is the trait that OpenDAL returns to callers.

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 whole content at once.

To append multiple bytes together, use append instead.

source

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

Append bytes to the writer.

It is highly recommended to align the length of the input bytes into blocks of 4MiB (except the last block) for better performance and compatibility.

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 the writer and make sure all data has been flushed.

Implementations on Foreign Types§

source§

impl Write for ()

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 append<'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,

source§

impl<T: Write + ?Sized> Write for Box<T>

Box<dyn Write> won’t implement Write automatically. To make Writer work as expected, we must add this impl.

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 append<'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§