Struct partiql_source_map::location::LineAndCharPosition
source · pub struct LineAndCharPosition {
pub line: LineOffset,
pub char: CharOffset,
}
Expand description
A 0-indexed line & char absolute position (i.e., relative to the start of a &str)
Example
assert_eq!("Beginning of &str: LineAndCharPosition { line: LineOffset(0), char: CharOffset(0) }",
format!("Beginning of &str: {:?}", LineAndCharPosition::new(0, 0)));
Fields§
§line: LineOffset
The 0-indexed line absolute position (i.e., relative to the start of a &str)
char: CharOffset
The 0-indexed character absolute position (i.e., relative to the start of a &str)
Implementations§
source§impl LineAndCharPosition
impl LineAndCharPosition
sourcepub fn new(line: usize, char: usize) -> Self
pub fn new(line: usize, char: usize) -> Self
Constructs at LineAndCharPosition
Trait Implementations§
source§impl Clone for LineAndCharPosition
impl Clone for LineAndCharPosition
source§fn clone(&self) -> LineAndCharPosition
fn clone(&self) -> LineAndCharPosition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LineAndCharPosition
impl Debug for LineAndCharPosition
source§impl From<LineAndCharPosition> for LineAndColumn
impl From<LineAndCharPosition> for LineAndColumn
source§fn from(_: LineAndCharPosition) -> Self
fn from(_: LineAndCharPosition) -> Self
Converts to this type from the input type.
source§impl Hash for LineAndCharPosition
impl Hash for LineAndCharPosition
source§impl Ord for LineAndCharPosition
impl Ord for LineAndCharPosition
source§fn cmp(&self, other: &LineAndCharPosition) -> Ordering
fn cmp(&self, other: &LineAndCharPosition) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<LineAndCharPosition> for LineAndCharPosition
impl PartialEq<LineAndCharPosition> for LineAndCharPosition
source§fn eq(&self, other: &LineAndCharPosition) -> bool
fn eq(&self, other: &LineAndCharPosition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<LineAndCharPosition> for LineAndCharPosition
impl PartialOrd<LineAndCharPosition> for LineAndCharPosition
source§fn partial_cmp(&self, other: &LineAndCharPosition) -> Option<Ordering>
fn partial_cmp(&self, other: &LineAndCharPosition) -> Option<Ordering>
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 LineAndCharPosition
impl Eq for LineAndCharPosition
impl StructuralEq for LineAndCharPosition
impl StructuralPartialEq for LineAndCharPosition
Auto Trait Implementations§
impl RefUnwindSafe for LineAndCharPosition
impl Send for LineAndCharPosition
impl Sync for LineAndCharPosition
impl Unpin for LineAndCharPosition
impl UnwindSafe for LineAndCharPosition
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.