pub struct Position {
pub line: u32,
pub column: u32,
}Expand description
Position.
Positions are used to represent a specific point in a text file, typically for error reporting or debugging purposes. They are defined by a line and column number, both of which use 0-based indexing, which is what the Language Server Protocol and Source Maps require.
However, when printing via fmt::Display, the line and column numbers
are formatted as 1-based indices, which is what most editors use.
Fields§
§line: u32Line number, 0-based.
column: u32Column number, 0-based.
Implementations§
Trait Implementations§
Source§impl Ord for Position
impl Ord for Position
Source§impl PartialOrd for Position
impl PartialOrd for Position
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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