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 PartialOrd for Location
impl PartialOrd for Location
impl Copy for Location
impl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementationsยง
impl Freeze for Location
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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more