Skip to main content

AsyncFileReader

Trait AsyncFileReader 

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

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

The asynchronous interface used by super::AsyncAvroFileReader to read avro files

Notes:

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

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

Required Methods§

Source

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

Retrieve the bytes in range

Provided Methods§

Source

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

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( &mut self, range: Range<u64>, ) -> BoxFuture<'_, Result<Bytes, AvroError>>

Retrieve the bytes in range
Source§

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

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,

Source§

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

Source§

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

Implementors§

Source§

impl AsyncFileReader for AvroObjectReader

Source§

impl<T: AsyncRead + AsyncSeek + Unpin + Send> AsyncFileReader for T