subspace_data_retrieval::segment_downloading

Function download_segment_pieces

Source
pub async fn download_segment_pieces<PG>(
    segment_index: SegmentIndex,
    piece_getter: &PG,
) -> Result<Vec<Option<Piece>>, SegmentDownloadingError>
where PG: PieceGetter,
Expand description

Downloads pieces of the segment such that segment can be reconstructed afterward.

Prefers source pieces if available, on error returns number of downloaded pieces