pub async fn download_segment_pieces<PG>(
segment_index: SegmentIndex,
piece_getter: &PG,
retries: usize,
retry_delay: Option<Duration>,
) -> Result<Vec<Option<Piece>>, SegmentDownloadingError>where
PG: PieceGetter,
Expand description
Downloads pieces of a segment so that segment can be reconstructed afterward. Repeatedly attempts to download pieces until the required number of pieces is reached.
Prefers source pieces if available, on error returns the number of available pieces.