pub enum Error {
    IOErr(StringErrorKind),
    UnexpectedData {
        expected: Vec<u8>,
        received: Vec<u8>,
    },
    CorruptedData,
    CountError,
    TooLargeReadErr,
    HexError(String),
    SortError,
    DuplicateError,
    InvalidBlockVersion,
    UnsupportedProtocolVersion,
}
Expand description

Possible errors deriving from serializing or deserializing.

Variants

IOErr(StringErrorKind)

Wraps an io error produced when reading or writing

UnexpectedData

Fields

expected: Vec<u8>

What we wanted

received: Vec<u8>

What we got

Expected a given value that wasn’t found

CorruptedData

Data wasn’t in a consumable format

CountError

Incorrect number of elements (when deserializing a vec via read_multi say).

TooLargeReadErr

When asked to read too much data

HexError(String)

Error from from_hex deserialization

SortError

Inputs/outputs/kernels must be sorted lexicographically.

DuplicateError

Inputs/outputs/kernels must be unique.

InvalidBlockVersion

Block header version (hard-fork schedule).

UnsupportedProtocolVersion

Unsupported protocol version

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

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Converts a reference to Self into a dynamic trait object of Fail.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the “name” of the error. Read more

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

Provides context for this failure. Read more

Wraps this failure in a compatibility wrapper that implements std::error::Error. 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.

Should always be Self

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.