Skip to main content

AsyncReader

Trait AsyncReader 

Source
pub trait AsyncReader<'a> {
    type Reader: RangeReader;

    // Required methods
    fn metadata<'async_trait>(
        &'a mut self,
    ) -> Pin<Box<dyn Future<Output = Result<FileMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn blob_reader(
        &'a mut self,
        blob_metadata: &BlobMetadata,
    ) -> Result<Self::Reader>;
}
Expand description

AsyncReader defines an asynchronous reader for puffin data.

Required Associated Types§

Source

type Reader: RangeReader

Required Methods§

Source

fn metadata<'async_trait>( &'a mut self, ) -> Pin<Box<dyn Future<Output = Result<FileMetadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Fetches the FileMetadata.

Source

fn blob_reader( &'a mut self, blob_metadata: &BlobMetadata, ) -> Result<Self::Reader>

Reads particular blob data based on given metadata.

Data read from the reader is compressed leaving the caller to decompress the data.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, R: RangeReader + 'a> AsyncReader<'a> for PuffinFileReader<R>