Skip to main content

ErrorKind

Enum ErrorKind 

Source
pub enum ErrorKind {
Show 33 variants UnexpectedChar(char), UnexpectedToken(String), InvalidBitPattern(String), ExpectedToken(String), InvalidRange, InvalidWidth(u32), MissingDecoderBlock, DuplicateInstructionName(String), DuplicateTypeAlias(String), BitCoverageGap { instruction: String, missing_bits: Vec<u32>, }, OverlappingBits { instruction: String, bit: u32, }, UnresolvedType(String), PatternConflict { a: String, b: String, }, PatternLengthMismatch { instruction: String, expected: u32, got: u32, }, UnusedImport(String), InvalidFormatString(String), InvalidGuard(String), UndefinedFieldInFormat { instruction: String, field: String, }, UndefinedFieldInGuard { instruction: String, field: String, }, UndefinedMap(String), MapArgCountMismatch { map: String, expected: usize, got: usize, }, DuplicateMapEntry { map: String, }, DuplicateMapName(String), UnguardedNonLastFormatLine { instruction: String, }, UnknownBuiltinFunction(String), CrossUnitBoundary { instruction: String, range_start: u32, range_end: u32, width: u32, }, ExceedsMaxUnits { instruction: String, required: u32, max_units: u32, }, InconsistentFragmentNames { subdecoder: String, instruction: String, expected: Vec<String>, got: Vec<String>, }, SubDecoderFieldTooWide { field: String, field_width: u32, subdecoder: String, subdecoder_width: u32, }, UndefinedSubDecoder(String), UndefinedFragment { subdecoder: String, fragment: String, }, CircularInclude(String), IncludeNotFound(String),
}
Expand description

Kinds of errors that can occur during parsing and validation.

Variants§

§

UnexpectedChar(char)

Unexpected character in input

§

UnexpectedToken(String)

Unexpected token

§

InvalidBitPattern(String)

Invalid bit pattern syntax

§

ExpectedToken(String)

Expected token missing

§

InvalidRange

Invalid bit range specification

§

InvalidWidth(u32)

Invalid decoder width value

§

MissingDecoderBlock

Missing decoder block in definition

§

DuplicateInstructionName(String)

Two instructions have the same name

§

DuplicateTypeAlias(String)

Two type aliases have the same name

§

BitCoverageGap

Instruction doesn’t specify bits for all positions

Fields

§instruction: String
§missing_bits: Vec<u32>
§

OverlappingBits

Instruction specifies overlapping bits

Fields

§instruction: String
§bit: u32
§

UnresolvedType(String)

Field references an undefined type

§

PatternConflict

Two instructions have the same fixed bit pattern

Fields

§

PatternLengthMismatch

Fixed bit pattern length doesn’t match range width

Fields

§instruction: String
§expected: u32
§got: u32
§

UnusedImport(String)

An import statement is unused

§

InvalidFormatString(String)

Invalid format string syntax

§

InvalidGuard(String)

Invalid guard condition syntax

§

UndefinedFieldInFormat

Format string references undefined field

Fields

§instruction: String
§field: String
§

UndefinedFieldInGuard

Guard references undefined field

Fields

§instruction: String
§field: String
§

UndefinedMap(String)

Map call references undefined map

§

MapArgCountMismatch

Map call has wrong number of arguments

Fields

§expected: usize
§got: usize
§

DuplicateMapEntry

Duplicate entry in a map

Fields

§

DuplicateMapName(String)

Duplicate map name

§

UnguardedNonLastFormatLine

Non-last format line without a guard condition

Fields

§instruction: String
§

UnknownBuiltinFunction(String)

Unknown builtin function name

§

CrossUnitBoundary

A bit range spans across unit boundaries

Fields

§instruction: String
§range_start: u32
§range_end: u32
§width: u32
§

ExceedsMaxUnits

Instruction requires more units than max_units allows

Fields

§instruction: String
§required: u32
§max_units: u32
§

InconsistentFragmentNames

Fragment names differ between instructions in the same sub-decoder

Fields

§subdecoder: String
§instruction: String
§expected: Vec<String>
§

SubDecoderFieldTooWide

Field bit-width exceeds sub-decoder’s declared width

Fields

§field: String
§field_width: u32
§subdecoder: String
§subdecoder_width: u32
§

UndefinedSubDecoder(String)

Referenced sub-decoder doesn’t exist

§

UndefinedFragment

Dotted access to a non-existent fragment name

Fields

§subdecoder: String
§fragment: String
§

CircularInclude(String)

Circular include detected

§

IncludeNotFound(String)

Included file not found

Trait Implementations§

Source§

impl Clone for ErrorKind

Source§

fn clone(&self) -> ErrorKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ErrorKind

Source§

fn eq(&self, other: &ErrorKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ErrorKind

Source§

impl StructuralPartialEq for ErrorKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.