Trait lance_io::traits::Reader

source ·
pub trait Reader: Send + Sync {
    // Required methods
    fn path(&self) -> &Path;
    fn block_size(&self) -> usize;
    fn size<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_range<'life0, 'async_trait>(
        &'life0 self,
        range: Range<usize>
    ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn path(&self) -> &Path

source

fn block_size(&self) -> usize

Suggest optimal I/O size per storage device.

source

fn size<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Object/File Size.

source

fn get_range<'life0, 'async_trait>( &'life0 self, range: Range<usize> ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read a range of bytes from the object.

TODO: change to read_at()?

Implementors§