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: LineOffsetThe 0-indexed line absolute position (i.e., relative to the start of a &str)
char: CharOffsetThe 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 duplicate 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 for LineAndCharPosition
impl PartialEq for LineAndCharPosition
Source§impl PartialOrd for LineAndCharPosition
impl PartialOrd for LineAndCharPosition
impl Copy for LineAndCharPosition
impl Eq for LineAndCharPosition
impl StructuralPartialEq for LineAndCharPosition
Auto Trait Implementations§
impl Freeze for LineAndCharPosition
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.