Skip to main content

PositionRead

Trait PositionRead 

Source
pub trait PositionRead:
    Send
    + Sync
    + Unpin
    + 'static {
    type Handle: Send + Sync + Unpin + 'static;

    // Required methods
    fn open(
        &self,
    ) -> impl Future<Output = Result<Self::Handle, Error>> + MaybeSend;
    fn read_at(
        handle: &Self::Handle,
        offset: u64,
        size: usize,
    ) -> impl Future<Output = Result<Buffer, Error>> + MaybeSend;
}
Expand description

PositionRead is used to implement oio::Read based on positioned reads.

Services that implement PositionRead create a positioned read handle lazily and must support position-independent reads on that handle. size is the maximum number of bytes to read, and implementations may return fewer bytes. Returning an empty buffer means EOF.

Required Associated Types§

Source

type Handle: Send + Sync + Unpin + 'static

The opened positioned read handle.

Required Methods§

Source

fn open(&self) -> impl Future<Output = Result<Self::Handle, Error>> + MaybeSend

Open the positioned read handle.

Source

fn read_at( handle: &Self::Handle, offset: u64, size: usize, ) -> impl Future<Output = Result<Buffer, Error>> + MaybeSend

Read up to size bytes from offset.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§