subspace_farmer::farm

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

Implementors§