Enum bip_metainfo::PieceAccess
[−]
[src]
pub enum PieceAccess<'a> { Compute(&'a mut Read), PreComputed(ShaHash), }
Type of access given for computing (or not) the checksums for torrent files.
Implementations should typically choose to invoke the access_pieces
callback
with all Compute
variants, or all PreComputed
variants. It is allowable to
mix and match variants between calls, but any PreComputed
hashes will be
considered as the next checksum to be put in the torrent file, so implementations
will typically want to align calls with Compute
to a piece length boundary
(though not required).
Variants
Compute(&'a mut Read)
Hash should be computed from the bytes read.
PreComputed(ShaHash)
Hash given should be used directly as the next checksum.