Struct Crc

struct Crc<W: Width, I: Implementation = Table<1>> { ... }

Crc instance with a specific width, algorithm, and implementation.

Fields

algorithm: &'static Algorithm<W>

Implementations

impl<L: usize> Crc<u128, Table<L>>

const fn new(algorithm: &'static Algorithm<u128>) -> Self
const fn checksum(self: &Self, bytes: &[u8]) -> u128
const fn digest(self: &Self) -> Digest<'_, u128, Table<L>>
const fn digest_with_initial(self: &Self, initial: u128) -> Digest<'_, u128, Table<L>>

Construct a Digest with a given initial value.

This overrides the initial value specified by the algorithm. The effects of the algorithm's properties refin and width are applied to the custom initial value.

const fn table(self: &Self) -> &<Table<L> as Implementation>::Data<u128>

impl<L: usize> Crc<u16, Table<L>>

const fn new(algorithm: &'static Algorithm<u16>) -> Self
const fn checksum(self: &Self, bytes: &[u8]) -> u16
const fn digest(self: &Self) -> Digest<'_, u16, Table<L>>
const fn digest_with_initial(self: &Self, initial: u16) -> Digest<'_, u16, Table<L>>

Construct a Digest with a given initial value.

This overrides the initial value specified by the algorithm. The effects of the algorithm's properties refin and width are applied to the custom initial value.

const fn table(self: &Self) -> &<Table<L> as Implementation>::Data<u16>

impl<L: usize> Crc<u32, Table<L>>

const fn new(algorithm: &'static Algorithm<u32>) -> Self
const fn checksum(self: &Self, bytes: &[u8]) -> u32
const fn digest(self: &Self) -> Digest<'_, u32, Table<L>>
const fn digest_with_initial(self: &Self, initial: u32) -> Digest<'_, u32, Table<L>>

Construct a Digest with a given initial value.

This overrides the initial value specified by the algorithm. The effects of the algorithm's properties refin and width are applied to the custom initial value.

const fn table(self: &Self) -> &<Table<L> as Implementation>::Data<u32>

impl<L: usize> Crc<u64, Table<L>>

const fn new(algorithm: &'static Algorithm<u64>) -> Self
const fn checksum(self: &Self, bytes: &[u8]) -> u64
const fn digest(self: &Self) -> Digest<'_, u64, Table<L>>
const fn digest_with_initial(self: &Self, initial: u64) -> Digest<'_, u64, Table<L>>

Construct a Digest with a given initial value.

This overrides the initial value specified by the algorithm. The effects of the algorithm's properties refin and width are applied to the custom initial value.

const fn table(self: &Self) -> &<Table<L> as Implementation>::Data<u64>

impl<L: usize> Crc<u8, Table<L>>

const fn new(algorithm: &'static Algorithm<u8>) -> Self
const fn checksum(self: &Self, bytes: &[u8]) -> u8
const fn digest(self: &Self) -> Digest<'_, u8, Table<L>>
const fn digest_with_initial(self: &Self, initial: u8) -> Digest<'_, u8, Table<L>>

Construct a Digest with a given initial value.

This overrides the initial value specified by the algorithm. The effects of the algorithm's properties refin and width are applied to the custom initial value.

const fn table(self: &Self) -> &<Table<L> as Implementation>::Data<u8>

impl<T> Any for Crc<W, I>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Crc<W, I>

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

impl<T> BorrowMut for Crc<W, I>

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

impl<T> CloneToUninit for Crc<W, I>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Crc<W, I>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Crc<W, I>

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<W, I>

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

impl<T, U> TryInto for Crc<W, I>

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

impl<W, I> Freeze for Crc<W, I>

impl<W, I> RefUnwindSafe for Crc<W, I>

impl<W, I> Send for Crc<W, I>

impl<W, I> Sync for Crc<W, I>

impl<W, I> Unpin for Crc<W, I>

impl<W, I> UnwindSafe for Crc<W, I>

impl<W: $crate::clone::Clone + Width, I: $crate::clone::Clone + Implementation> Clone for Crc<W, I>

fn clone(self: &Self) -> Crc<W, I>