Trait opendal::raw::oio::Write

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

Write whole content at once.

To append multiple bytes together, use append instead.

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.

Close the writer and make sure all data has been flushed.

Implementations on Foreign Types§

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

Implementors§