pub struct InnerTokenizer<'a> { /* private fields */ }

Implementations

Create a new InnerTokenizer

Get the next char and it’s index

Peek at the next char and index without moving forward

Peek, but you don’t care about the index

Peek but you only need the index.

Call before creating a token, marks the start before reading it (token_res calls this ready for the next token, but it is safe to do again)

Drop the current peek and make sure new lines and stuff are counted This guarantees the following call to next (or peek) will be new

Build a TokenRes from the status of the with the string of the current value unpeek should be true if the last peeked character is part if the current token

When an item must be followed by a specific character to give a fixed result

When an item must be followed by a set of options which could produce different results

// after an equals
tok.follow_fn(|c|match c {
    '>'=>Ok(MyToken::Arrow),
    '='=>Ok(MyToken::EqEq),
    _=>Err("Equals Needs a GT or another Equals"),
})

When an item may be followed by a specific 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 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.