Struct Crc

struct Crc { ... }

The CRC calculated by a CrcReader.

Implementations

impl Crc

fn new() -> Self

Create a new CRC.

fn sum(self: &Self) -> u32

Returns the current crc32 checksum.

fn amount(self: &Self) -> u32

The 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(self: &mut Self, data: &[u8])

Update the CRC with the bytes in data.

fn reset(self: &mut Self)

Reset the CRC.

fn combine(self: &mut Self, additional_crc: &Crc)

Combine the CRC with the CRC for the subsequent block of bytes.

impl Debug for Crc

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Default for Crc

fn default() -> Crc

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

impl<T> Any for Crc

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Crc

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Crc

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Crc

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Crc

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Crc

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Crc

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>