Trait opendal::raw::oio::Write

source ·
pub trait Write: Unpin + Send + Sync {
    // Required methods
    fn write(
        &mut self,
        bs: Buffer
    ) -> impl Future<Output = Result<usize>> + MaybeSend;
    fn close(&mut self) -> impl Future<Output = Result<()>> + MaybeSend;
    fn abort(&mut self) -> impl Future<Output = Result<()>> + MaybeSend;
}
Expand description

Write is the trait that OpenDAL returns to callers.

Required Methods§

source

fn write( &mut self, bs: Buffer ) -> impl Future<Output = Result<usize>> + MaybeSend

Available on non-WebAssembly only.

Write given bytes into writer.

§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) -> impl Future<Output = Result<()>> + MaybeSend

Available on non-WebAssembly only.

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

source

fn abort(&mut self) -> impl Future<Output = Result<()>> + MaybeSend

Available on non-WebAssembly only.

Abort the pending writer.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Write for ()

source§

async fn write(&mut self, _: Buffer) -> Result<usize>

Available on non-WebAssembly only.
source§

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

Available on non-WebAssembly only.
source§

async fn abort(&mut self) -> Result<()>

Available on non-WebAssembly only.
source§

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

source§

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

Available on non-WebAssembly only.
source§

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

Available on non-WebAssembly only.
source§

async fn abort(&mut self) -> Result<()>

Available on non-WebAssembly only.

Implementors§

source§

impl<ONE: Write, TWO: Write> Write for TwoWays<ONE, TWO>

source§

impl<ONE: Write, TWO: Write, THREE: Write> Write for ThreeWays<ONE, TWO, THREE>

source§

impl<W> Write for AppendWriter<W>
where W: AppendWrite,

source§

impl<W> Write for BlockWriter<W>
where W: BlockWrite,

source§

impl<W> Write for MultipartWriter<W>
where W: MultipartWrite,

source§

impl<W: OneShotWrite> Write for OneShotWriter<W>

source§

impl<W: RangeWrite> Write for RangeWriter<W>

source§

impl<W: Write> Write for ChunkedWriter<W>