Trait ParserInput

Source
pub trait ParserInput: Clone + Iterator<Item = TokenAndSpan> {
    type State: Debug;

    // Required methods
    fn start_pos(&mut self) -> BytePos;
    fn state(&mut self) -> Self::State;
    fn reset(&mut self, state: &Self::State);
    fn take_errors(&mut self) -> Vec<Error>;
    fn skip_ws(&mut self) -> Option<BytePos>;
    fn atom(&self, s: Cow<'_, str>) -> Atom;
}

Required Associated Types§

Required Methods§

Source

fn start_pos(&mut self) -> BytePos

Source

fn state(&mut self) -> Self::State

Source

fn reset(&mut self, state: &Self::State)

Source

fn take_errors(&mut self) -> Vec<Error>

Source

fn skip_ws(&mut self) -> Option<BytePos>

Returns last_pos

Source

fn atom(&self, s: Cow<'_, str>) -> Atom

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§

Source§

impl ParserInput for Input<'_>

Source§

impl<'a, I> ParserInput for Lexer<'a, I>
where I: Input<'a>,