Function filecoin_proofs::pieces::get_aligned_source

source ยท
pub fn get_aligned_source<T: Read>(
    source: T,
    pieces: &[UnpaddedBytesAmount],
    piece_bytes: UnpaddedBytesAmount,
) -> (UnpaddedBytesAmount, PieceAlignment, impl Read)
Expand description

Given an enumeration of pieces in a staged sector and a piece to be added (represented by a Read and corresponding length, in UnpaddedBytesAmount) to the staged sector, produce a new Read and UnpaddedBytesAmount pair which includes the appropriate amount of alignment bytes for the piece to be written to the target staged sector.