pub enum DataEncodingTestFailure<T>{
EncoderFailure(IoError),
DecoderFailure(DecodeError, Vec<u8>),
TranscodedObjectDiffersFromOriginal {
original: T,
transcoded: T,
},
TranscodedVecDiffersFromOriginal {
original: Vec<u8>,
transcoded: Vec<u8>,
object: T,
},
}
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(IoError)
Failure during encoding enum variant
DecoderFailure(DecodeError, Vec<u8>)
Failure during decoding binary representation of enum variant
TranscodedObjectDiffersFromOriginal
Fields
§
original: T
Original value, which was encoded
§
transcoded: T
The value resulting from decoding encoded original
value
Test case failure representing mismatch between object produced by decoding from the originally encoded object
TranscodedVecDiffersFromOriginal
Fields
§
object: T
Object decoded from the test vector
Test case failure representing mismatch between original test vector and serialization of the object decoded from that test vector
Trait Implementations§
source§impl<T> Clone for DataEncodingTestFailure<T>
impl<T> Clone for DataEncodingTestFailure<T>
source§fn clone(&self) -> DataEncodingTestFailure<T>
fn clone(&self) -> DataEncodingTestFailure<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for DataEncodingTestFailure<T>
impl<T> Debug for DataEncodingTestFailure<T>
source§impl<T> Display for DataEncodingTestFailure<T>
impl<T> Display for DataEncodingTestFailure<T>
source§impl<T> Error for DataEncodingTestFailure<T>
impl<T> Error for DataEncodingTestFailure<T>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T> From<DataEncodingTestFailure<T>> for String
impl<T> From<DataEncodingTestFailure<T>> for String
source§fn from(err: DataEncodingTestFailure<T>) -> Self
fn from(err: DataEncodingTestFailure<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<Error> for DataEncodingTestFailure<T>
impl<T> From<Error> for DataEncodingTestFailure<T>
source§impl<T> PartialEq for DataEncodingTestFailure<T>
impl<T> PartialEq for DataEncodingTestFailure<T>
source§fn 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 ==
.impl<T> Eq for DataEncodingTestFailure<T>
impl<T> StructuralEq for DataEncodingTestFailure<T>
impl<T> StructuralPartialEq for DataEncodingTestFailure<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DataEncodingTestFailure<T>
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>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more