Trait bitar::archive_reader::ArchiveReader

source ·
pub trait ArchiveReader {
    type Error;

    // Required methods
    fn read_at<'a, 'async_trait>(
        &'a mut self,
        offset: u64,
        size: usize
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn read_chunks<'a>(
        &'a mut self,
        chunks: Vec<ChunkOffset>
    ) -> Pin<Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Send + 'a>>;
}
Expand description

Trait may be implemented for any type to be read as an archive.

Required Associated Types§

Required Methods§

source

fn read_at<'a, 'async_trait>( &'a mut self, offset: u64, size: usize ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Read a single chunk from archive.

source

fn read_chunks<'a>( &'a mut self, chunks: Vec<ChunkOffset> ) -> Pin<Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Send + 'a>>

Read multiple chunks from archive. Returns a stream of the requested chunks.

Implementors§