Skip to main content

Read

Trait Read 

Source
pub trait Read:
    Unpin
    + Send
    + Sync {
    // Required methods
    fn open(
        &self,
        range: BytesRange,
    ) -> impl Future<Output = Result<(RpRead, Box<dyn ReadStreamDyn>)>> + MaybeSend;
    fn read(
        &self,
        range: BytesRange,
    ) -> impl Future<Output = Result<(RpRead, Buffer)>> + MaybeSend;
}
Expand description

Read is the internal trait used by OpenDAL to read ranges from storage.

Users should not use or import this trait unless they are implementing an Accessor.

Required Methods§

Source

fn open( &self, range: BytesRange, ) -> impl Future<Output = Result<(RpRead, Box<dyn ReadStreamDyn>)>> + MaybeSend

Open a range stream for the given range.

Source

fn read( &self, range: BytesRange, ) -> impl Future<Output = Result<(RpRead, Buffer)>> + MaybeSend

Read an exact bounded range into Buffer.

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.

Implementations on Foreign Types§

Source§

impl Read for ()

Source§

async fn open(&self, _: BytesRange) -> Result<(RpRead, Box<dyn ReadStreamDyn>)>

Source§

async fn read(&self, _: BytesRange) -> Result<(RpRead, Buffer)>

Source§

impl<T: ReadDyn + ?Sized> Read for Box<T>

Source§

async fn open( &self, range: BytesRange, ) -> Result<(RpRead, Box<dyn ReadStreamDyn>)>

Source§

async fn read(&self, range: BytesRange) -> Result<(RpRead, Buffer)>

Implementors§