Function filecoin_proofs_api::seal::unseal_range
source · pub fn unseal_range<T: Into<PathBuf> + AsRef<Path>, R: Read, W: Write>(
registered_proof: RegisteredSealProof,
cache_path: T,
sealed_sector: R,
unsealed_output: W,
prover_id: ProverId,
sector_id: SectorId,
comm_d: Commitment,
ticket: Ticket,
offset: UnpaddedByteIndex,
num_bytes: UnpaddedBytesAmount,
) -> Result<UnpaddedBytesAmount>
Expand description
Unseals the sector read from sealed_sector
and returns the bytes for a
piece whose first (unpadded) byte begins at offset
and ends at offset
plus num_bytes
, inclusive. Note that the entire sector is unsealed each
time this function is called.
§Arguments
registered_proof
- Selected seal operation.cache_path
- Path to the directory in which the sector data’s Merkle tree is written.sealed_sector
- A byte source from which we read sealed sector data.unsealed_output
- A byte sink to which we write unsealed, un-bit-padded sector bytes.prover_id
- Unique ID of the storage provider.sector_id
- ID of the sector, usually relative to the miner.comm_d
- The commitment to the sector’s data.ticket
- The ticket that was used to generate the sector’s replica-id.offset
- The byte index in the unsealed sector of the first byte that we want to read.num_bytes
- The number of bytes that we want to read.
Returns count of bytes unsealed.