pub struct ChecksumBuilder<'a> { /* private fields */ }Expand description
A builder to update the digest of the checksum incrementally.
Sometimes we don’t have a continuous buffer for creating a checksum, so calling Checksum::generate_byte would require us to allocate a completely new buffer. Since we’re not actually storing much data for calculating the checksum, it might be better to instead build up the checksum in individual steps.
let checksum = Checksum::new(0);
let mut builder = checksum.builder();
let crc = builder.update(&[0x01, 0x01]).update_byte(1).update(&[0x05]).digest();Implementations§
Source§impl<'a> ChecksumBuilder<'a>
impl<'a> ChecksumBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for ChecksumBuilder<'a>
impl<'a> RefUnwindSafe for ChecksumBuilder<'a>
impl<'a> Send for ChecksumBuilder<'a>
impl<'a> Sync for ChecksumBuilder<'a>
impl<'a> Unpin for ChecksumBuilder<'a>
impl<'a> UnwindSafe for ChecksumBuilder<'a>
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