pub struct ParseString<'a> {
    pub graphemes: &'a Vec<&'a str>,
    pub error_log: Vec<(SourceRange, ParseErrorDetail)>,
    pub cursor: usize,
    pub location: SourceLocation,
}
Expand description

The input type for nom parsers. Instead of holding the actual input string, this struct only holds a reference to that string so that it can be cloned at much lower cost.

Fields§

§graphemes: &'a Vec<&'a str>

Source code

§error_log: Vec<(SourceRange, ParseErrorDetail)>

Error report, a list of (error_location, error_context)

§cursor: usize

Point at the next grapheme to consume

§location: SourceLocation

Location of the grapheme pointed by cursor

Implementations§

Must always point a an actual string

Get remaining (unparsed) length

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

Calculates the input length, as indicated by its name, and the name of the trait itself

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.