Struct rustc_lexer::cursor::Cursor[][src]

pub(crate) struct Cursor<'a> {
    initial_len: usize,
    chars: Chars<'a>,
    prev: char,
}
Expand description

Peekable iterator over a char sequence.

Next characters can be peeked via nth_char method, and position can be shifted forward via bump method.

Fields

initial_len: usizechars: Chars<'a>prev: char

Implementations

Returns the last eaten symbol (or '\0' in release builds). (For debug assertions only.)

Returns nth character relative to the current cursor position. If requested position doesn’t exist, EOF_CHAR is returned. However, getting EOF_CHAR doesn’t always mean actual end of file, it should be checked with is_eof method.

Peeks the next symbol from the input stream without consuming it.

Peeks the second symbol from the input stream without consuming it.

Checks if there is nothing more to consume.

Returns amount of already consumed symbols.

Returns a Chars iterator over the remaining characters.

Moves to the next character.

Parses a token from the input string.

Eats double-quoted string and returns true if string is terminated.

Eats the double-quoted string and returns n_hashes and an error if encountered.

Eats the float exponent. Returns true if at least one digit was met, and returns false otherwise.

Eats symbols while predicate returns true or until the end of file is reached.

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

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes