subspace_data_retrieval::piece_getter

Trait ObjectPieceGetter

source
pub trait ObjectPieceGetter: Debug {
    // Required method
    fn get_piece<'life0, 'async_trait>(
        &'life0 self,
        piece_index: PieceIndex,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, BoxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait representing a way to get pieces from the DSN for object reconstruction

Required Methods§

source

fn get_piece<'life0, 'async_trait>( &'life0 self, piece_index: PieceIndex, ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, BoxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get piece by index.

Returns Ok(None) if the piece is not found. Returns Err(_) if trying to get the piece caused an error.

Implementations on Foreign Types§

source§

impl ObjectPieceGetter for (PieceIndex, Piece)

source§

fn get_piece<'life0, 'async_trait>( &'life0 self, piece_index: PieceIndex, ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, BoxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl ObjectPieceGetter for NewArchivedSegment

source§

fn get_piece<'life0, 'async_trait>( &'life0 self, piece_index: PieceIndex, ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, BoxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<T> ObjectPieceGetter for Arc<T>
where T: ObjectPieceGetter + Send + Sync + ?Sized,

source§

fn get_piece<'life0, 'async_trait>( &'life0 self, piece_index: PieceIndex, ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, BoxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§