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§
sourcefn 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,
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.