pub enum EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug, {
EncoderFailure(T, Error),
DecoderFailure(T, Error, Vec<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(u8, Error),
UnknownDecodesToVariant(u8, T),
FailedEq(T),
FailedNe(T, T),
FailedOrd(T, T),
}
use strict_encoding_test crate instead
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, Error)
use strict_encoding_test crate instead
Failure during encoding enum variant
DecoderFailure(T, Error, Vec<u8>)
use strict_encoding_test crate instead
Failure during decoding binary representation of enum variant
DecodedDiffersFromOriginal
Fields
use strict_encoding_test crate instead
Test case failure representing mismatch between enum variant produced by decoding from the originally encoded enum variant
ValueMismatch
Fields
enum_name: &'static str
use strict_encoding_test crate instead
Name of the enum being tested
variant_name: &'static str
use strict_encoding_test crate instead
Name of the enum variant being tested
expected: usize
use strict_encoding_test crate instead
Expected primitive value for the tested enum variant
actual: usize
use strict_encoding_test crate instead
Actual primitive value of the tested enum variant
use strict_encoding_test crate instead
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
use strict_encoding_test crate instead
Name of the enum being tested
variant_name: &'static str
use strict_encoding_test crate instead
Name of the enum variant being tested
use strict_encoding_test crate instead
Test case failure representing failed byte string representation of the encoded enum variant
DecoderWrongErrorOnUnknownValue(u8, Error)
Tuple Fields
0: u8
use strict_encoding_test crate instead
Value which was decoded into an enum variant
1: Error
use strict_encoding_test crate instead
Error which was produced during decoding that value
use strict_encoding_test crate instead
Test case failure representing incorrect decoder error during processing out-of-enum range value
UnknownDecodesToVariant(u8, T)
Tuple Fields
0: u8
use strict_encoding_test crate instead
Value which was decoded into an enum variant
use strict_encoding_test crate instead
Test case failure representing a out-of-enum range primitive value still being interpreted as one of enum variants
FailedEq(T)
Tuple Fields
use strict_encoding_test crate instead
Test case failure due to wrong PartialEq
or Eq
implementation:
enum variant is not equal to itself
FailedNe(T, T)
Tuple Fields
use strict_encoding_test crate instead
Test case failure due to wrong PartialEq
or Eq
implementation:
two distinct enum variants are still equal
FailedOrd(T, T)
Tuple Fields
use strict_encoding_test crate instead
Test case failure due to wrong PartialOrd
or Ord
implementation
happening when enum variants ordering is broken
Trait Implementations
sourceimpl<T: Clone> Clone for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
impl<T: Clone> Clone for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
sourcefn clone(&self) -> EnumEncodingTestFailure<T>
fn clone(&self) -> EnumEncodingTestFailure<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Error for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
impl<T> Error for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl<T> From<EnumEncodingTestFailure<T>> for String where
T: Clone + PartialEq + Debug,
impl<T> From<EnumEncodingTestFailure<T>> for String where
T: Clone + PartialEq + Debug,
sourcefn from(err: EnumEncodingTestFailure<T>) -> Self
fn from(err: EnumEncodingTestFailure<T>) -> Self
Converts to this type from the input type.
sourceimpl<T: PartialEq> PartialEq<EnumEncodingTestFailure<T>> for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
impl<T: PartialEq> PartialEq<EnumEncodingTestFailure<T>> for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
sourcefn eq(&self, other: &EnumEncodingTestFailure<T>) -> bool
fn eq(&self, other: &EnumEncodingTestFailure<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &EnumEncodingTestFailure<T>) -> bool
fn ne(&self, other: &EnumEncodingTestFailure<T>) -> bool
This method tests for !=
.
impl<T> StructuralPartialEq for EnumEncodingTestFailure<T> where
T: Clone + PartialEq + Debug,
Auto Trait Implementations
impl<T> RefUnwindSafe for EnumEncodingTestFailure<T> where
T: RefUnwindSafe,
impl<T> Send for EnumEncodingTestFailure<T> where
T: Send,
impl<T> Sync for EnumEncodingTestFailure<T> where
T: Sync,
impl<T> Unpin for EnumEncodingTestFailure<T> where
T: Unpin,
impl<T> UnwindSafe for EnumEncodingTestFailure<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more