ChunkReader

Trait ChunkReader 

Source
pub trait ChunkReader {
    // Required method
    fn fetch_octets<'life0, 'async_trait>(
        &'life0 self,
        id: ResourceId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ChunkReaderError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for reading chunks of data from a source.

This trait provides a platform-agnostic way to read data chunks, with different implementations for file system and WebAssembly environments.

Required Methods§

Source

fn fetch_octets<'life0, 'async_trait>( &'life0 self, id: ResourceId, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ChunkReaderError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches a chunk of data from the specified resource.

§Arguments
  • id - The identifier for the resource to read
§Returns
  • Ok(Vec<u8>) - The bytes read from the resource
  • Err(ChunkReaderError) - If the read operation fails

Implementors§