pub enum EnumEncodingTestFailure<T> where
    T: Clone + PartialEq + Debug
{ EncoderFailure(T, String), DecoderFailure(T, StringVec<u8>), DecodedDiffersFromOriginal { original: T, decoded: T, }, ValueMismatch { enum_name: &'static str, variant_name: &'static str, expected: usize, actual: usize, }, EncodedValueMismatch { enum_name: &'static str, variant_name: &'static str, expected: Vec<u8>, actual: Vec<u8>, }, DecoderWrongErrorOnUnknownValue(u8String), UnknownDecodesToVariant(u8, T), FailedEq(T), FailedNe(T, T), FailedOrd(T, T), }
Expand description

Failures happening during strict encoding tests of enum encodings.

NB: These errors are specific for testing configuration and should not be used in non-test environment.

Variants

EncoderFailure(T, String)

Failure during encoding enum variant

DecoderFailure(T, StringVec<u8>)

Failure during decoding binary representation of enum variant

DecodedDiffersFromOriginal

Fields

original: T

Original value, which was encoded

decoded: T

The value resulting from decoding encoded original value

Test case failure representing mismatch between enum variant produced by decoding from the originally encoded enum variant

ValueMismatch

Fields

enum_name: &'static str

Name of the enum being tested

variant_name: &'static str

Name of the enum variant being tested

expected: usize

Expected primitive value for the tested enum variant

actual: usize

Actual primitive value of the tested enum variant

Test case failure representing mismatch between expected enum variant primitive value and the actual primitive value assigned to the enum variant by the rust compiler

EncodedValueMismatch

Fields

enum_name: &'static str

Name of the enum being tested

variant_name: &'static str

Name of the enum variant being tested

expected: Vec<u8>

Expected encoded byte string for the tested enum variant

actual: Vec<u8>

Actual encoded byte string of the tested enum variant

Test case failure representing failed byte string representation of the encoded enum variant

DecoderWrongErrorOnUnknownValue(u8String)

Tuple Fields

0: u8

Value which was decoded into an enum variant

1: String

Error which was produced during decoding that value

Test case failure representing incorrect decoder error during processing out-of-enum range value

UnknownDecodesToVariant(u8, T)

Tuple Fields

0: u8

Value which was decoded into an enum variant

1: T

Enum variant resulting from decoding wrong value

Test case failure representing a out-of-enum range primitive value still being interpreted as one of enum variants

FailedEq(T)

Tuple Fields

0: T

Enum variant which is not equal to itself

Test case failure due to wrong PartialEq or Eq implementation: enum variant is not equal to itself

FailedNe(T, T)

Tuple Fields

0: T

First of two enum variants which are treated as equal

1: T

Second of two enum variants which are treated as equal

Test case failure due to wrong PartialEq or Eq implementation: two distinct enum variants are still equal

FailedOrd(T, T)

Tuple Fields

0: T

First of two enum variants which are disordered. This variant should smaller than the second one, but Ord operation treats it as a larger one

1: T

Second of two enum variants which are disordered. This variant should larger than the second one, but Ord operation treats it as a smaller one

Test case failure due to wrong PartialOrd or Ord implementation happening when enum variants ordering is broken

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.