struct StringReader<'a> {
    sess: &'a ParseSess,
    start_pos: BytePos,
    pos: BytePos,
    src: &'a str,
    override_span: Option<Span>,
}

Fields

sess: &'a ParseSessstart_pos: BytePos

Initial position, read-only.

pos: BytePos

The absolute offset within the source_map of the current character.

src: &'a str

Source text to tokenize.

override_span: Option<Span>

Implementations

Returns the next token, and info about preceding whitespace, if any.

Report a fatal lexical error with a given span.

Report a lexical error with a given span.

Report a fatal error spanning [from_pos, to_pos).

Report a lexical error spanning [from_pos, to_pos).

Detect usages of Unicode codepoints changing the direction of the text on screen and loudly complain about it.

Turns simple rustc_lexer::TokenKind enum into a rich rustc_ast::TokenKind. This turns strings into interned symbols and runs additional validation.

Slice of the source text from start up to but excluding self.pos, meaning the slice does not include the character self.ch.

As symbol_from, with an explicit endpoint.

Slice of the source text spanning from start up to but excluding end.

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.

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: 48 bytes