pub struct ParseError<'a> {
    pub cause_range: SourceRange,
    pub remaining_input: ParseString<'a>,
    pub error_detail: ParseErrorDetail,
}
Expand description

The error type for the nom parser, which handles full error context (location + detail) and ownership of the input ParseString.

Eventually error context will be logged and ownership will be moved out.

Fields§

§cause_range: SourceRange

Cause range is defined as [start, end), where start points at the first character that’s catched by a label, and end points at the next character of the character that didn’t match.

Example: index: 1234567 input: abcdefg error: ~~~^ range: | | [2, 5)

§remaining_input: ParseString<'a>

Hold ownership to the input ParseString

§error_detail: ParseErrorDetail

Detailed information about this error

Implementations§

Create a new error at current location of the input, with given message and empty annotations. Ownership of the input is also passed into this error object.

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

Required by nom

Not used, unless we have logical error

Probably not used

Barely used, but we do want to keep the error with larger depth.

Creates an error from an input position and an expected character

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

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.