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§
sourcefn write(&mut self, bs: Buffer) -> Result<()>
fn write(&mut self, bs: Buffer) -> Result<()>
Write whole content at once.
§Behavior
Ok(n)
meansn
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.
Implementations on Foreign Types§
source§impl BlockingWrite for ()
impl BlockingWrite for ()
source§impl<T: BlockingWrite + ?Sized> BlockingWrite for Box<T>
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.