pub struct Cursor<R> { /* private fields */ }
Expand description

Cursor over the source code.

Implementations§

Gets the current position of the cursor in the source code.

Advances the position to the next column.

Advances the position to the next line.

Creates a new Lexer cursor.

Peeks the next byte.

Peeks the next n bytes, the maximum number of peeked bytes is 4 (n <= 4).

Peeks the next UTF-8 character in u32 code point.

Compares the byte passed in to the next byte, if they match true is returned and the buffer is incremented

Applies the predicate to the next UTF-8 character and returns the result. Returns false if there is no next character, otherwise returns the result from the predicate on the ascii char

The buffer is not incremented.

Retrieves the next byte.

Retrieves the next UTF-8 character.

Trait Implementations§

Formats the value using the given formatter. Read more

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 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.