pub struct SourcePos {
pub line: usize,
pub col: usize,
}Expand description
A line/column position in source text (1-indexed).
Fields§
§line: usize1-indexed line number.
col: usize1-indexed column number (byte offset within the line).
Implementations§
Source§impl SourcePos
impl SourcePos
Sourcepub fn advance_col(&self) -> Self
pub fn advance_col(&self) -> Self
Advance by one ASCII character (no newline).
Sourcepub fn advance_line(&self) -> Self
pub fn advance_line(&self) -> Self
Advance to the next line (column resets to 1).
Trait Implementations§
Source§impl Ord for SourcePos
impl Ord for SourcePos
Source§impl PartialOrd for SourcePos
impl PartialOrd for SourcePos
impl Copy for SourcePos
impl Eq for SourcePos
impl StructuralPartialEq for SourcePos
Auto Trait Implementations§
impl Freeze for SourcePos
impl RefUnwindSafe for SourcePos
impl Send for SourcePos
impl Sync for SourcePos
impl Unpin for SourcePos
impl UnsafeUnpin for SourcePos
impl UnwindSafe for SourcePos
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more