Trait rhai::InputStream

source ·
pub trait InputStream {
    // Required methods
    fn unget(&mut self, ch: char);
    fn get_next(&mut self) -> Option<char>;
    fn peek_next(&mut self) -> Option<char>;

    // Provided method
    fn eat_next_and_advance(&mut self, pos: &mut Position) -> Option<char> { ... }
}
Expand description

(internals) Trait that encapsulates a peekable character input stream. Exported under the internals feature only.

Required Methods§

source

fn unget(&mut self, ch: char)

Un-get a character back into the InputStream. The next get_next or peek_next will return this character instead.

source

fn get_next(&mut self) -> Option<char>

Get the next character from the InputStream.

source

fn peek_next(&mut self) -> Option<char>

Peek the next character in the InputStream.

Provided Methods§

source

fn eat_next_and_advance(&mut self, pos: &mut Position) -> Option<char>

Consume the next character.

Implementors§