[][src]Trait moore::lexer::Reader

pub trait Reader {
    pub fn peek(&mut self, offset: usize) -> Option<char>;
pub fn consume(&mut self, amount: usize);
pub fn clear(&mut self);
pub fn to_string(&self) -> String; }

A trait that can supply a peekable stream of characters.

Required methods

pub fn peek(&mut self, offset: usize) -> Option<char>[src]

pub fn consume(&mut self, amount: usize)[src]

pub fn clear(&mut self)[src]

pub fn to_string(&self) -> String[src]

Loading content...

Implementors

impl Reader for AccumulatingReader[src]

pub fn peek(&mut self, off: usize) -> Option<char>[src]

Return the value of the byte that is off bytes away from the current position in the input file. If the off lies beyond the end of file, None is returned.

pub fn consume(&mut self, amt: usize)[src]

Consume the next amt bytes of the input. All consumed bytes since the last clear() can be accessed via slice() or to_string().

pub fn clear(&mut self)[src]

Clear the consumed bytes.

pub fn to_string(&self) -> String[src]

Convert the consumed bytes to a String.

impl<'tdata> Reader for StringReader<'tdata>[src]

Loading content...