Enum boxcars::CrcCheck

source ·
pub enum CrcCheck {
    Always,
    Never,
    OnError,
}
Expand description

Determines under what circumstances the parser should perform the crc check for replay corruption. Since the crc check is the most time consuming part when parsing the header, clients should choose under what circumstances a crc check is performed.

Variants§

§

Always

Always perform the crc check. Useful when the replay has had its contents modified. This will catch a user that increased the number of goals they scored (easy) but only if they didn’t update the crc as well (not as easy).

§

Never

Never perform the crc check. Useful only when it doesn’t matter to know if a replay is corrupt or not, you either want the data or the parsing error.

§

OnError

Only perform the crc check when parsing a section fails. This option gets the best of both worlds. If parsing fails, the crc check will determine if it is a programming error or the replay is corrupt. If parsing succeeds it won’t precious time performing the check. This option is the default for parsing.

Trait Implementations§

source§

impl Clone for CrcCheck

source§

fn clone(&self) -> CrcCheck

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CrcCheck

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq for CrcCheck

source§

fn eq(&self, other: &CrcCheck) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for CrcCheck

source§

impl Eq for CrcCheck

source§

impl StructuralPartialEq for CrcCheck

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.