pub struct SourcePosition(pub(crate) usize);Expand description
A position from the start of the input, counted in UTF-8 bytes.
Tuple Fields§
§0: usizeImplementations§
Source§impl SourcePosition
 
impl SourcePosition
Sourcepub fn byte_index(&self) -> usize
 
pub fn byte_index(&self) -> usize
Returns the current byte index in the original input.
Trait Implementations§
Source§impl Clone for SourcePosition
 
impl Clone for SourcePosition
Source§fn clone(&self) -> SourcePosition
 
fn clone(&self) -> SourcePosition
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 SourcePosition
 
impl Debug 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
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