Trait pest::Input [] [src]

pub trait Input<'a> {
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn pos(&self) -> usize;
    fn set_pos(&mut self, pos: usize);
    fn slice(&self, start: usize, end: usize) -> &'a str;
    fn line_col(&self, pos: usize) -> (usize, usize);
    fn match_string(&mut self, string: &str) -> bool;
    fn match_insensitive(&mut self, string: &str) -> bool;
    fn match_range(&mut self, left: char, right: char) -> bool;
}

A trait that defines an input for a Parser.

Required Methods

Returns length of an Input.

Returns whether an Input is empty.

Returns current position of an Input.

Set current position of an Input.

Slices an Input.

Returns the line and column of a position for an Input.

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

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

Matches if an Input's current char is between left and right, and advances the position with one char in case it did.

Implementors