Struct litrs::ParseError[][src]

pub struct ParseError { /* fields omitted */ }
Expand description

Errors during parsing.

This type should be seen primarily for error reporting and not for catching specific cases. The span and error kind are not guaranteed to be stable over different versions of this library, meaning that a returned error can change from one version to the next. There are simply too many fringe cases that are not easy to classify as a specific error kind. It depends entirely on the specific parser code how an invalid input is categorized.

Consider these examples:

  • '\ can be seen as
    • invalid escape in character literal, or
    • unterminated character literal.
  • ''' can be seen as
    • empty character literal, or
    • unescaped quote character in character literal.
  • 0b64 can be seen as
    • binary integer literal with invalid digit 6, or
    • binary integer literal with invalid digit 4, or
    • decimal integer literal with invalid digit b, or
    • decimal integer literal 0 with unknown type suffix b64.

If you want to see more if these examples, feel free to check out the unit tests of this library.

While this library does its best to emit sensible and precise errors, and to keep the returned errors as stable as possible, full stability cannot be guaranteed.

Implementations

Returns a span of this error, if available. Note: the returned span might change in future versions of this library. See the documentation of this type for more information.

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

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.