pub struct StreamVerifier<H: Hasher> { /* private fields */ }Expand description
Stream verifier for checksum verification.
Implementations§
Source§impl StreamVerifier<Sha256Hasher>
impl StreamVerifier<Sha256Hasher>
Sourcepub fn new(config: ChecksumConfig) -> Result<Self>
pub fn new(config: ChecksumConfig) -> Result<Self>
Create a new stream verifier with the given configuration.
Source§impl<H: Hasher> StreamVerifier<H>
impl<H: Hasher> StreamVerifier<H>
Sourcepub fn finalize(&mut self) -> Result<bool>
pub fn finalize(&mut self) -> Result<bool>
Finalize verification and check if the checksum matches.
Sourcepub fn bytes_processed(&self) -> usize
pub fn bytes_processed(&self) -> usize
Get the number of bytes processed so far.
Sourcepub fn algorithm(&self) -> HashAlgorithm
pub fn algorithm(&self) -> HashAlgorithm
Get the configured algorithm.
Sourcepub fn expected_checksum(&self) -> &str
pub fn expected_checksum(&self) -> &str
Get the expected checksum.
Sourcepub fn is_finalized(&self) -> bool
pub fn is_finalized(&self) -> bool
Check if the verifier has been finalized.
Auto Trait Implementations§
impl<H> Freeze for StreamVerifier<H>where
H: Freeze,
impl<H> RefUnwindSafe for StreamVerifier<H>where
H: RefUnwindSafe,
impl<H> Send for StreamVerifier<H>
impl<H> Sync for StreamVerifier<H>where
H: Sync,
impl<H> Unpin for StreamVerifier<H>where
H: Unpin,
impl<H> UnsafeUnpin for StreamVerifier<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for StreamVerifier<H>where
H: UnwindSafe,
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