perplex_runtime

Trait ParserInput

Source
pub trait ParserInput {
    type Item;

    // Required methods
    fn peek(&mut self) -> &Self::Item;
    fn next(&mut self) -> Self::Item;
    fn marker() -> Self::Item;
}
Expand description

An stream of tokens that can be used as parser input.

Required Associated Types§

Source

type Item

The token type produced by the stream.

Required Methods§

Source

fn peek(&mut self) -> &Self::Item

Peek at the next item in the stream.

Source

fn next(&mut self) -> Self::Item

Consume the next item in the stream.

Source

fn marker() -> Self::Item

Returns the end-of-stream marker.

The stream will continue to produce this marker once reaching the end. Code calling peek() or next() must compare the result to this marker to dedect the end of the input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§