Skip to main content

PositionWrite

Trait PositionWrite 

Source
pub trait PositionWrite:
    Send
    + Sync
    + Unpin
    + 'static {
    // Required methods
    fn write_all_at(
        &self,
        offset: u64,
        buf: Buffer,
    ) -> impl Future<Output = Result<()>> + MaybeSend;
    fn close(&self) -> impl Future<Output = Result<Metadata>> + MaybeSend;
    fn abort(&self) -> impl Future<Output = Result<()>> + MaybeSend;
}
Expand description

PositionWrite is used to implement oio::Write based on position write.

§Services

Services like fs support position write.

§Architecture

The architecture after adopting PositionWrite:

  • Services impl PositionWrite
  • PositionWriter impl Write
  • Expose PositionWriter as Accessor::Writer

§Requirements

Services that implement PositionWrite must fulfill the following requirements:

  • Writing data based on position: offset.

Required Methods§

Source

fn write_all_at( &self, offset: u64, buf: Buffer, ) -> impl Future<Output = Result<()>> + MaybeSend

write_all_at is used to write the data to underlying storage at the specified offset.

Source

fn close(&self) -> impl Future<Output = Result<Metadata>> + MaybeSend

close is used to close the underlying file.

Source

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

abort is used to abort the underlying abort.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§