Skip to main content

PieceReader

Trait PieceReader 

Source
pub trait PieceReader:
    Send
    + Sync
    + Debug {
    // Required method
    fn read_piece<'life0, 'async_trait>(
        &'life0 self,
        sector_index: SectorIndex,
        piece_offset: PieceOffset,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, FarmError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Abstract piece reader implementation

Required Methods§

Source

fn read_piece<'life0, 'async_trait>( &'life0 self, sector_index: SectorIndex, piece_offset: PieceOffset, ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, FarmError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read piece from sector by offset, None means input parameters are incorrect or piece reader was shut down

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§