pub enum DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone, {
EncoderFailure(Error),
DecoderFailure(Error, Vec<u8>),
EncoderReturnedWrongLength {
actual: usize,
returned: usize,
},
TranscodedObjectDiffersFromOriginal {
original: T,
transcoded: T,
},
TranscodedVecDiffersFromOriginal {
original: Vec<u8>,
transcoded: Vec<u8>,
object: T,
},
}
use strict_encoding_test crate instead
Expand description
Failures happening during strict encoding tests of struct and union encodings.
NB: These errors are specific for testing configuration and should not be used in non-test environment.
Variants
EncoderFailure(Error)
Tuple Fields
use strict_encoding_test crate instead
Failure during encoding enum variant
DecoderFailure(Error, Vec<u8>)
Tuple Fields
use strict_encoding_test crate instead
Failure during decoding binary representation of enum variant
EncoderReturnedWrongLength
Fields
actual: usize
use strict_encoding_test crate instead
Actual length of the serialized data
returned: usize
use strict_encoding_test crate instead
Incorrect length returned by the encoder
use strict_encoding_test crate instead
Failure of the strict encode implementation: encoder reports incorrect length of the serialized data
TranscodedObjectDiffersFromOriginal
Fields
use strict_encoding_test crate instead
Test case failure representing mismatch between object produced by decoding from the originally encoded object
TranscodedVecDiffersFromOriginal
Fields
original: Vec<u8>
use strict_encoding_test crate instead
Original test vector, which was decoded
use strict_encoding_test crate instead
Test case failure representing mismatch between original test vector and serialization of the object decoded from that test vector
Trait Implementations
sourceimpl<T: Clone> Clone for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
impl<T: Clone> Clone for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
sourcefn clone(&self) -> DataEncodingTestFailure<T>
fn clone(&self) -> DataEncodingTestFailure<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: Debug> Debug for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
impl<T: Debug> Debug for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
sourceimpl<T> Display for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
impl<T> Display for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
sourceimpl<T> Error for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
impl<T> Error for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
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<DataEncodingTestFailure<T>> for String where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
impl<T> From<DataEncodingTestFailure<T>> for String where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
sourcefn from(err: DataEncodingTestFailure<T>) -> Self
fn from(err: DataEncodingTestFailure<T>) -> Self
Converts to this type from the input type.
sourceimpl<T: PartialEq> PartialEq<DataEncodingTestFailure<T>> for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
impl<T: PartialEq> PartialEq<DataEncodingTestFailure<T>> for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
sourcefn eq(&self, other: &DataEncodingTestFailure<T>) -> bool
fn eq(&self, other: &DataEncodingTestFailure<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DataEncodingTestFailure<T>) -> bool
fn ne(&self, other: &DataEncodingTestFailure<T>) -> bool
This method tests for !=
.
impl<T> StructuralPartialEq for DataEncodingTestFailure<T> where
T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
Auto Trait Implementations
impl<T> RefUnwindSafe for DataEncodingTestFailure<T> where
T: RefUnwindSafe,
impl<T> Send for DataEncodingTestFailure<T> where
T: Send,
impl<T> Sync for DataEncodingTestFailure<T> where
T: Sync,
impl<T> Unpin for DataEncodingTestFailure<T> where
T: Unpin,
impl<T> UnwindSafe for DataEncodingTestFailure<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