Enum strict_encoding::test_helpers::DataEncodingTestFailure[][src]

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, }, }
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

Failure during encoding enum variant

Tuple Fields of EncoderFailure

0: Error

Encoder error

DecoderFailure

Failure during decoding binary representation of enum variant

Tuple Fields of DecoderFailure

0: Error

Decoder error

1: Vec<u8>

Byte string which failed to decode

EncoderReturnedWrongLength

Failure of the strict encode implementation: encoder reports incorrect length of the serialized data

Fields of EncoderReturnedWrongLength

actual: usize

Actual length of the serialized data

returned: usize

Incorrect length returned by the encoder

TranscodedObjectDiffersFromOriginal

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

Fields of TranscodedObjectDiffersFromOriginal

original: T

Original value, which was encoded

transcoded: T

The value resulting from decoding encoded original value

TranscodedVecDiffersFromOriginal

Test case failure representing mismatch between original test vector and serialization of the object decoded from that test vector

Fields of TranscodedVecDiffersFromOriginal

original: Vec<u8>

Original test vector, which was decoded

transcoded: Vec<u8>

Byte string produced by encoding object, decoded from the test vector

object: T

Object decoded from the test vector

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.