pub enum StreamingChecksum {
Sha256(Sha256),
Crc64nvme(Crc64Nvme),
}Expand description
One full-object checksum folded over a payload delivered in pieces.
This is the streaming form of StorageChecksum::matches, for a reader
that verifies an object it never holds whole. The two agree about what
this build can recompute: StreamingChecksum::for_algorithm answers
None for exactly the algorithms matches refuses to judge, so an
unverifiable checksum is refused before any bytes move rather than after.
Variants§
Sha256(Sha256)
SHA-256 folded over the payload.
Crc64nvme(Crc64Nvme)
CRC-64/NVME folded over the payload.
Implementations§
Source§impl StreamingChecksum
impl StreamingChecksum
Sourcepub fn for_algorithm(algorithm: ChecksumAlgorithm) -> Option<Self>
pub fn for_algorithm(algorithm: ChecksumAlgorithm) -> Option<Self>
Starts an empty digest for algorithm, or None when this build
cannot recompute that algorithm.
Sourcepub fn finish(self) -> StorageChecksum
pub fn finish(self) -> StorageChecksum
Closes the digest over everything fed so far.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingChecksum
impl RefUnwindSafe for StreamingChecksum
impl Send for StreamingChecksum
impl Sync for StreamingChecksum
impl Unpin for StreamingChecksum
impl UnsafeUnpin for StreamingChecksum
impl UnwindSafe for StreamingChecksum
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more