pub trait AsyncFileReader:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Vec<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
The asynchronous interface used to read COG files
This was derived from the Parquet
AsyncFileReader
Notes:
-
ObjectReader, available when theobject_storecrate feature is enabled, implements this interface forObjectStore. -
You can use [
TokioReader] to implementAsyncFileReaderfor types that implementtokio::io::AsyncReadandtokio::io::AsyncSeek, for exampletokio::fs::File.
Required Methods§
Sourcefn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve the bytes in range as part of a request for image data, not header metadata.
This is also used as the default implementation of
MetadataFetch if not overridden.
Provided Methods§
Sourcefn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve multiple byte ranges as part of a request for image data, not header metadata. 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,
impl AsyncFileReader for Box<dyn AsyncFileReader + '_>
This allows Box<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,
Source§fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
range as part of a request for image data, not header metadata. Read moreSource§fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
get_bytes sequentiallyImplementations on Foreign Types§
Source§impl AsyncFileReader for Box<dyn AsyncFileReader + '_>
This allows Box<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,
impl AsyncFileReader for Box<dyn AsyncFileReader + '_>
This allows Box<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,
fn get_bytes<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_byte_ranges<'life0, 'async_trait>(
&'life0 self,
ranges: Vec<Range<u64>>,
) -> Pin<Box<dyn Future<Output = AsyncTiffResult<Vec<Bytes>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl AsyncFileReader for Arc<dyn AsyncFileReader + '_>
This allows Arc<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,
impl AsyncFileReader for Arc<dyn AsyncFileReader + '_>
This allows Arc<dyn AsyncFileReader + ’_> to be used as an AsyncFileReader,