pub struct SourcePosition { /* private fields */ }
Expand description
A reference to a line and column in an input source file
Implementations§
Source§impl SourcePosition
impl SourcePosition
Sourcepub fn index(&self) -> usize
pub fn index(&self) -> usize
The index of the character in the input source
Zero-based index. Take a substring of the original source starting at
this index to access the item pointed to by this SourcePosition
.
Trait Implementations§
Source§impl Clone for SourcePosition
impl Clone for SourcePosition
Source§fn clone(&self) -> SourcePosition
fn clone(&self) -> SourcePosition
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 SourcePosition
impl Debug for SourcePosition
Source§impl Display for SourcePosition
impl Display for SourcePosition
Source§impl Hash for SourcePosition
impl Hash for SourcePosition
Source§impl Ord for SourcePosition
impl Ord for SourcePosition
Source§fn cmp(&self, other: &SourcePosition) -> Ordering
fn cmp(&self, other: &SourcePosition) -> 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 SourcePosition
impl PartialEq for SourcePosition
Source§impl PartialOrd for SourcePosition
impl PartialOrd for SourcePosition
Source§impl Serialize for SourcePosition
impl Serialize for SourcePosition
impl Copy for SourcePosition
impl Eq for SourcePosition
impl StructuralPartialEq for SourcePosition
Auto Trait Implementations§
impl Freeze for SourcePosition
impl RefUnwindSafe for SourcePosition
impl Send for SourcePosition
impl Sync for SourcePosition
impl Unpin for SourcePosition
impl UnwindSafe for SourcePosition
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.