Trait AsyncFileReader

Source
pub trait AsyncFileReader:
    Debug
    + Send
    + Sync {
    // Required method
    fn get_bytes(
        &self,
        range: Range<u64>,
    ) -> BoxFuture<'_, AsyncTiffResult<Bytes>>;

    // Provided method
    fn get_byte_ranges(
        &self,
        ranges: Vec<Range<u64>>,
    ) -> BoxFuture<'_, AsyncTiffResult<Vec<Bytes>>> { ... }
}
Expand description

The asynchronous interface used to read COG files

This was derived from the Parquet AsyncFileReader

Notes:

  1. There is a default implementation for types that implement [tokio::io::AsyncRead] and [tokio::io::AsyncSeek], for example tokio::fs::File.

  2. ObjectReader, available when the object_store crate feature is enabled, implements this interface for ObjectStore.

Required Methods§

Source

fn get_bytes(&self, range: Range<u64>) -> BoxFuture<'_, AsyncTiffResult<Bytes>>

Retrieve the bytes in range

Provided Methods§

Source

fn get_byte_ranges( &self, ranges: Vec<Range<u64>>, ) -> BoxFuture<'_, AsyncTiffResult<Vec<Bytes>>>

Retrieve multiple byte ranges. The default implementation will call get_bytes sequentially

Trait Implementations§

Source§

impl AsyncFileReader for Box<dyn AsyncFileReader + '_>

This allows Box<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,

Source§

fn get_bytes(&self, range: Range<u64>) -> BoxFuture<'_, AsyncTiffResult<Bytes>>

Retrieve the bytes in range
Source§

fn get_byte_ranges( &self, ranges: Vec<Range<u64>>, ) -> BoxFuture<'_, AsyncTiffResult<Vec<Bytes>>>

Retrieve multiple byte ranges. The default implementation will call get_bytes sequentially

Implementations on Foreign Types§

Source§

impl AsyncFileReader for Box<dyn AsyncFileReader + '_>

This allows Box<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,

Implementors§