subspace_data_retrieval::piece_fetcher

Function download_pieces

source
pub async fn download_pieces<PG>(
    piece_indexes: &[PieceIndex],
    piece_getter: &PG,
) -> Result<Vec<Piece>, BoxError>
Expand description

Concurrently downloads the exact pieces in piece_indexes, returning them in that order. Each piece index must be unique.

If any piece can’t be downloaded, returns an error.