Parser

Trait Parser 

Source
pub trait Parser {
    // Required methods
    fn check_event(&self) -> bool;
    fn peek_event(&self) -> Result<Option<&Event>>;
    fn get_event(&mut self) -> Result<Option<Event>>;
    fn reset(&mut self);
    fn position(&self) -> Position;
}
Expand description

Trait for YAML parsers that convert token streams to events

Required Methods§

Source

fn check_event(&self) -> bool

Check if there are more events available

Source

fn peek_event(&self) -> Result<Option<&Event>>

Peek at the next event without consuming it

Source

fn get_event(&mut self) -> Result<Option<Event>>

Get the next event, consuming it

Source

fn reset(&mut self)

Reset the parser state

Source

fn position(&self) -> Position

Get the current position in the input

Implementors§