pub struct ChecksummedWriter { /* private fields */ }Expand description
A streaming writer that computes a checksum as it writes.
Implementations§
Source§impl ChecksummedWriter
impl ChecksummedWriter
Sourcepub fn write_byte(&mut self, b: u8)
pub fn write_byte(&mut self, b: u8)
Write a byte, updating the checksum.
Sourcepub fn write_bytes(&mut self, data: &[u8])
pub fn write_bytes(&mut self, data: &[u8])
Write multiple bytes.
Sourcepub fn write_string(&mut self, s: &str)
pub fn write_string(&mut self, s: &str)
Write a string (length-prefixed).
Sourcepub fn current_checksum(&self) -> u32
pub fn current_checksum(&self) -> u32
Return the current running checksum.
Sourcepub fn finish_with_checksum(self) -> Vec<u8> ⓘ
pub fn finish_with_checksum(self) -> Vec<u8> ⓘ
Finish and return the data with appended checksum.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChecksummedWriter
impl RefUnwindSafe for ChecksummedWriter
impl Send for ChecksummedWriter
impl Sync for ChecksummedWriter
impl Unpin for ChecksummedWriter
impl UnsafeUnpin for ChecksummedWriter
impl UnwindSafe for ChecksummedWriter
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