Struct crc16::State
[−]
[src]
pub struct State<T> { /* fields omitted */ }
State of crc calculation.
Methods
impl<T: CrcType> State<T>
[src]
fn new() -> State<T>
[src]
Creates new state of given CRC type.
use crc16::*; let state = State::<ARC>::new();
fn update(&mut self, msg: &[u8])
[src]
Updates state with new data.
fn get(&self) -> u16
[src]
Returns CRC value of state.
fn calculate(msg: &[u8]) -> u16
[src]
Calculates CRC value of given type for given message.
use crc16::*; assert_eq!(State::<ARC>::calculate(b"123456789"), 0xBB3D);
Trait Implementations
impl<T: Copy> Copy for State<T>
[src]
impl<T: Clone> Clone for State<T>
[src]
fn clone(&self) -> State<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for State<T>
[src]
fn eq(&self, __arg_0: &State<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &State<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for State<T>
[src]
impl<T: CrcType> Hasher for State<T>
[src]
fn finish(&self) -> u64
[src]
Returns the hash value for the values written so far. Read more
fn write(&mut self, bytes: &[u8])
[src]
Writes some data into this Hasher
. Read more
fn write_u8(&mut self, i: u8)
1.3.0[src]
Writes a single u8
into this hasher.
fn write_u16(&mut self, i: u16)
1.3.0[src]
Writes a single u16
into this hasher.
fn write_u32(&mut self, i: u32)
1.3.0[src]
Writes a single u32
into this hasher.
fn write_u64(&mut self, i: u64)
1.3.0[src]
Writes a single u64
into this hasher.
fn write_u128(&mut self, i: u128)
[src]
i128
)Writes a single u128
into this hasher.
fn write_usize(&mut self, i: usize)
1.3.0[src]
Writes a single usize
into this hasher.
fn write_i8(&mut self, i: i8)
1.3.0[src]
Writes a single i8
into this hasher.
fn write_i16(&mut self, i: i16)
1.3.0[src]
Writes a single i16
into this hasher.
fn write_i32(&mut self, i: i32)
1.3.0[src]
Writes a single i32
into this hasher.
fn write_i64(&mut self, i: i64)
1.3.0[src]
Writes a single i64
into this hasher.
fn write_i128(&mut self, i: i128)
[src]
i128
)Writes a single i128
into this hasher.
fn write_isize(&mut self, i: isize)
1.3.0[src]
Writes a single isize
into this hasher.