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§
sourcefn write(
&mut self,
bs: Buffer
) -> impl Future<Output = Result<usize>> + MaybeSend
Available on non-WebAssembly only.
fn write( &mut self, bs: Buffer ) -> impl Future<Output = Result<usize>> + MaybeSend
Write given bytes into writer.
§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.
Object Safety§
This trait is not object safe.