Trait opendal::raw::oio::BlockingWrite

source ·
pub trait BlockingWrite: Send + Sync + 'static {
    // Required methods
    fn write(&mut self, bs: Buffer) -> Result<()>;
    fn close(&mut self) -> Result<()>;
}
Expand description

BlockingWrite is the trait that OpenDAL returns to callers.

Required Methods§

source

fn write(&mut self, bs: Buffer) -> Result<()>

Write whole content at once.

§Behavior
  • Ok(n) means n bytes has been written successfully.
  • Err(err) means error happens and no bytes has been written.

It’s possible that n < bs.len(), caller should pass the remaining bytes repeatedly until all bytes has been written.

source

fn close(&mut self) -> Result<()>

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

Implementations on Foreign Types§

source§

impl BlockingWrite for ()

source§

fn write(&mut self, bs: Buffer) -> Result<()>

source§

fn close(&mut self) -> Result<()>

source§

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

Box<dyn BlockingWrite> won’t implement BlockingWrite automatically.

To make BlockingWriter work as expected, we must add this impl.

source§

fn write(&mut self, bs: Buffer) -> Result<()>

source§

fn close(&mut self) -> Result<()>

Implementors§