pub struct Location {
pub row: usize,
pub col: usize,
}
Expand description
Records the location of a character within the source string.
Uses row
and col
. The first character of the source is
at row 1 and column 1. Column width aligns mostly with
displayed width of unicode characters and strings
according to the UAX#11 rules, with exceptions
made for compound emojis like 👩🔬. For example, most CJK characters
like 我 and 혇 occupies two column widths. And most emojis occupies
two column widths as well.
Fields§
§row: usize
§col: usize
Trait Implementations§
source§impl Ord for Location
impl Ord for Location
source§impl PartialEq<Location> for Location
impl PartialEq<Location> for Location
source§impl PartialOrd<Location> for Location
impl PartialOrd<Location> for Location
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Location
impl Eq for Location
impl StructuralEq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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