pub enum Error {
    Exhausted,
    Cursor(CursorError),
    BadContainer(String),
    BadBlockInfoCode(TryFromPrimitiveError<BlockInfoCode>),
    BadAbbrevOpEnc(TryFromPrimitiveError<AbbrevOpEnc>),
    StreamParse(String),
    AbbrevParse(String),
    BadAbbrev(u64),
    BadScope(String),
}
Expand description

All possible errors that can occur while parsing a bitstream.

Variants

Exhausted

The underlying bitstream has no more data to parse.

Cursor(CursorError)

The underlying BitCursor returned an error that we couldn’t specialize.

BadContainer(String)

We couldn’t parse the wrapper structure or other data that precedes the actual bitstream.

BadBlockInfoCode(TryFromPrimitiveError<BlockInfoCode>)

A record in the BLOCKINFO block has a code that we don’t know. BLOCKINFO must be fully interpreted in order to correctly parse the remainder of the bitstream, so this is a hard error.

BadAbbrevOpEnc(TryFromPrimitiveError<AbbrevOpEnc>)

An operand in a DEFINE_ABBREV definition has a code that we don’t know. This indicates either a malformed bitstream or a new operand format that we don’t yet support, so it’s a hard error.

StreamParse(String)

A generic error occurred while parsing the bitstream.

AbbrevParse(String)

An error occurred while interpreting a DEFINE_ABBREV record.

BadAbbrev(u64)

An error occurred while mapping an abbreviated record back to its abbreviation definition.

BadScope(String)

An error occurred during block scope entrance or exit.

Trait Implementations

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.

Performs the conversion.

Performs the conversion.

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.

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.