Struct Crc
pub struct Crc { /* private fields */ }
The CRC calculated by a CrcReader.
Implementations
impl Crc
fn new() -> SelfCreate a new CRC.
fn sum(&self) -> u32Returns the current crc32 checksum.
fn amount(&self) -> u32The number of bytes that have been used to calculate the CRC. This value is only accurate if the amount is lower than 232.
fn update(&mut self, data: &[u8])Update the CRC with the bytes in
data.fn reset(&mut self)Reset the CRC.
fn combine(&mut self, additional_crc: &Self)Combine the CRC with the CRC for the subsequent block of bytes.
Trait Implementations
impl Debug for Crc
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Crc
fn default() -> Self
Auto Trait Implementations
impl Freeze for Crc
impl RefUnwindSafe for Crc
impl Send for Crc
impl Sync for Crc
impl Unpin for Crc
impl UnsafeUnpin for Crc
impl UnwindSafe for Crc
Blanket Implementations
impl<T> Any for Crc
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Crc
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Crc
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Crc
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Crc
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Crc
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Crc
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>