pub async fn read_sector_record_chunks<S, A>(
piece_offset: PieceOffset,
pieces_in_sector: u16,
s_bucket_offsets: &[u32; 65536],
sector_contents_map: &SectorContentsMap,
pos_proofs: &PosProofs,
sector: &ReadAt<S, A>,
) -> Result<SectorRecordChunks, ReadingError>where
S: ReadAtSync,
A: ReadAtAsync,Expand description
Read sector record chunks, only plotted s-buckets are marked as present (in decoded form).
Returns ReadingError::PosProofsMismatch if the sector contents map has no entry for
piece_offset, or if the record’s chunks in it are not at exactly the s-buckets of
pos_proofs. Each chunk was encoded with the proof for its s-bucket, so chunks can’t be
decoded correctly otherwise.
NOTE: This is an async function, but it also does CPU-intensive operation internally, while it is not very long, make sure it is okay to do so in your context.