Struct malk_lexer::TextPos
[−]
[src]
pub struct TextPos { pub col: usize, pub line: usize, pub byte: usize, }
A position in a text document.
Fields
col: usize
The column number from the start of the line. Some wierd characters may take up multiple columns or no columns.
line: usize
The line number
byte: usize
The byte position from the start of the document.
Methods
impl TextPos
[src]
fn start() -> TextPos
Create a TextPos at the start of a document.
fn next(self, src: &str) -> Option<(char, TextPos)>
Advance a position by one character. Returns the character that was advanced past and the new position.
Trait Implementations
impl Debug for TextPos
[src]
impl Clone for TextPos
[src]
fn clone(&self) -> TextPos
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more