Trait Scanner

Source
pub trait Scanner {
    // Required methods
    fn check_token(&self) -> bool;
    fn peek_token(&self) -> Result<Option<&Token>>;
    fn get_token(&mut self) -> Result<Option<Token>>;
    fn reset(&mut self);
    fn position(&self) -> Position;
    fn input(&self) -> &str;
}
Expand description

Trait for YAML scanners that convert character streams to tokens

Required Methods§

Source

fn check_token(&self) -> bool

Check if there are more tokens available

Source

fn peek_token(&self) -> Result<Option<&Token>>

Peek at the next token without consuming it

Source

fn get_token(&mut self) -> Result<Option<Token>>

Get the next token, consuming it

Source

fn reset(&mut self)

Reset the scanner state

Source

fn position(&self) -> Position

Get the current position in the input

Source

fn input(&self) -> &str

Get the input text for error reporting

Implementors§