pub struct Position<FILE = ()> { /* private fields */ }Expand description
A position.
Characters in a text file can be organizes in a virtual grid in order to easily find characters or parsing errors inside the file. Each file can be divided in multiple lines separated by line feed (U+000A) or carriage return + line feed (U+000D + U+000A).
To find a character then you need just the index of the line containing it (the first line has index 0)
and the character index inside thai line (also called the column).
Type F is any type that can be used to identify a text file, for example a
String, a Path or a custom type.
Implementations§
Trait Implementations§
impl<FILE: Copy> Copy for Position<FILE>
impl<FILE: Eq> Eq for Position<FILE>
impl<FILE> StructuralPartialEq for Position<FILE>
Auto Trait Implementations§
impl<FILE> Freeze for Position<FILE>where
FILE: Freeze,
impl<FILE> RefUnwindSafe for Position<FILE>where
FILE: RefUnwindSafe,
impl<FILE> Send for Position<FILE>where
FILE: Send,
impl<FILE> Sync for Position<FILE>where
FILE: Sync,
impl<FILE> Unpin for Position<FILE>where
FILE: Unpin,
impl<FILE> UnwindSafe for Position<FILE>where
FILE: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)