subspace_data_retrieval::piece_fetcher

Function download_pieces

Source
pub async fn download_pieces<PG>(
    piece_indexes: &Vec<PieceIndex>,
    piece_getter: &PG,
) -> Result<Vec<Piece>>
where PG: PieceGetter,
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.