Trait pest::Input [] [src]

pub trait Input {
    fn len(&self) -> usize;
    fn pos(&self) -> usize;
    fn set_pos(&mut self, pos: usize);
    fn matches(&mut self, string: &str) -> bool;
}

A trait that defines an input for a Parser.

Required Methods

fn len(&self) -> usize

Returns length of an Input.

fn pos(&self) -> usize

Returns current position of an Input.

fn set_pos(&mut self, pos: usize)

Set current position of an Input.

fn matches(&mut self, string: &str) -> bool

Matches string to an Input, returns whether it matched, and advances the position with string.len() in case it did.

Implementors