Skip to main content

BufferProvider

Trait BufferProvider 

Source
pub trait BufferProvider {
    // Required methods
    fn current(&self) -> Option<char>;
    fn peek(&self) -> Option<char>;
    fn advance(&mut self) -> Option<char>;
    fn position(&self) -> &TextPosition;
    fn update_position(&mut self, ch: char);
}
Expand description

Buffer provider trait for reading characters

Required Methods§

Source

fn current(&self) -> Option<char>

Get the current character without advancing

Source

fn peek(&self) -> Option<char>

Get the next character without advancing

Source

fn advance(&mut self) -> Option<char>

Advance to the next character and return it

Source

fn position(&self) -> &TextPosition

Get current position for error reporting

Source

fn update_position(&mut self, ch: char)

Update position tracking

Implementors§