[][src]Enum cfg_lib::config::RecognizerError

pub enum RecognizerError {
    Io(Location),
    UnexpectedCharacter(charLocation),
    InvalidCharacter(charLocation),
    InvalidNumber(Location),
    UnterminatedString(Location),
    InvalidString(Location),
    UnexpectedToken(StringStringLocation),
    ValueExpected(StringLocation),
    AtomExpected(StringLocation),
    KeyExpected(StringLocation),
    KeyValueSeparatorExpected(StringLocation),
    ContainerExpected(StringLocation),
    InvalidEscapeSequence(usizeLocation),
    UnexpectedListSize(Location),
    TrailingText(Location),
}

This represents the low-level errors which can occur when parsing CFG source. They all include the source location where the error was detected.

Variants

This represents an I/O error (e.g. a network or disk read error).

UnexpectedCharacter(charLocation)

This represents an unexpected character at the start of a token.

InvalidCharacter(charLocation)

This represents a character which is invalid in the middle of a token.

InvalidNumber(Location)

This represents an invalid number.

UnterminatedString(Location)

This represents an unterminated string. The start of the string is returned.

InvalidString(Location)

This represents where an invalid string was detected. An example would be a back-tick string containing a newline character.

UnexpectedToken(StringStringLocation)

This represents where a particular token was expected but not found. The text of the expected token, the text of the actual token and the location are returned.

ValueExpected(StringLocation)

This represents where a value was expected but not found.

AtomExpected(StringLocation)

This represents where an "atom" (identifier, number, string etc.) was expected but not found.

KeyExpected(StringLocation)

This represents where a key (identifier or literal string) was expected but not found.

KeyValueSeparatorExpected(StringLocation)

This represents where a key/value separator was expected but not found.

ContainerExpected(StringLocation)

This represents that a valid container (mapping or list) was expected, but not found.

InvalidEscapeSequence(usizeLocation)

This representsd an invalid escape sequence.

UnexpectedListSize(Location)

This represents an unexpected list size. Currently, only one-dimensional lists are allowed.

TrailingText(Location)

This represents trailing text, e.g. at the end of an expression.

Trait Implementations

impl Debug for RecognizerError[src]

impl PartialEq<RecognizerError> for RecognizerError[src]

impl StructuralPartialEq for RecognizerError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.