Struct CrcReader

pub struct CrcReader<R> { /* private fields */ }

A wrapper around a Read that calculates the CRC.

Implementations

impl<R> CrcReader<R>

fn crc(&self) -> &Crc

Get the Crc for this CrcReader.

fn into_inner(self) -> R

Get the reader that is wrapped by this CrcReader.

fn get_ref(&self) -> &R

Get the reader that is wrapped by this CrcReader by reference.

fn get_mut(&mut self) -> &mut R

Get a mutable reference to the reader that is wrapped by this CrcReader.

fn reset(&mut self)

Reset the Crc in this CrcReader.

impl<R: Read> CrcReader<R>

fn new(r: R) -> CrcReader<R>

Create a new CrcReader.

Trait Implementations

impl<R: BufRead> BufRead for CrcReader<R>

fn fill_buf(&mut self) -> Result<&[u8]>
fn consume(&mut self, amt: usize)

impl<R: Debug> Debug for CrcReader<R>

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

impl<R: Read> Read for CrcReader<R>

fn read(&mut self, into: &mut [u8]) -> Result<usize>

Auto Trait Implementations

impl<R> Freeze for CrcReader<R> where R: Freeze,

impl<R> RefUnwindSafe for CrcReader<R> where R: RefUnwindSafe,

impl<R> Send for CrcReader<R> where R: Send,

impl<R> Sync for CrcReader<R> where R: Sync,

impl<R> Unpin for CrcReader<R> where R: Unpin,

impl<R> UnsafeUnpin for CrcReader<R> where R: UnsafeUnpin,

impl<R> UnwindSafe for CrcReader<R> where R: UnwindSafe,

Blanket Implementations

impl<T> Any for CrcReader<R> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for CrcReader<R> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for CrcReader<R> where T: ?Sized,

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

impl<T> From<T> for CrcReader<R>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for CrcReader<R> where U: From<T>,

fn into(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<U> for CrcReader<R> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for CrcReader<R> where U: TryFrom<T>,

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