Expand description
Struct which represents a position in a source file.
Fields
line: i32
Current line of the input
column: i32
Current column of the input
Implementations
sourceimpl SourcePosition
impl SourcePosition
Trait Implementations
sourceimpl Clone for SourcePosition
impl Clone for SourcePosition
sourcefn clone(&self) -> SourcePosition
fn clone(&self) -> SourcePosition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SourcePosition
impl Debug for SourcePosition
sourceimpl Default for SourcePosition
impl Default for SourcePosition
sourceimpl Display for SourcePosition
impl Display for SourcePosition
sourceimpl Ord for SourcePosition
impl Ord for SourcePosition
sourceimpl PartialEq<SourcePosition> for SourcePosition
impl PartialEq<SourcePosition> for SourcePosition
sourcefn eq(&self, other: &SourcePosition) -> bool
fn eq(&self, other: &SourcePosition) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SourcePosition) -> bool
fn ne(&self, other: &SourcePosition) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SourcePosition> for SourcePosition
impl PartialOrd<SourcePosition> for SourcePosition
sourcefn partial_cmp(&self, other: &SourcePosition) -> Option<Ordering>
fn partial_cmp(&self, other: &SourcePosition) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Positioner<char> for SourcePosition
impl Positioner<char> for SourcePosition
type Position = SourcePosition
type Position = SourcePosition
The type which keeps track of the position
type Checkpoint = SourcePosition
sourcefn position(&self) -> SourcePosition
fn position(&self) -> SourcePosition
Returns the current position
sourcefn update(&mut self, token: &char)
fn update(&mut self, token: &char)
Updates the position given that token
has been taken from the stream
fn checkpoint(&self) -> Self::Checkpoint
fn reset(&mut self, checkpoint: Self::Checkpoint)
sourceimpl Positioner<u8> for SourcePosition
impl Positioner<u8> for SourcePosition
type Position = SourcePosition
type Position = SourcePosition
The type which keeps track of the position
type Checkpoint = SourcePosition
sourcefn position(&self) -> SourcePosition
fn position(&self) -> SourcePosition
Returns the current position
sourcefn update(&mut self, token: &u8)
fn update(&mut self, token: &u8)
Updates the position given that token
has been taken from the stream
fn checkpoint(&self) -> Self::Checkpoint
fn reset(&mut self, checkpoint: Self::Checkpoint)
sourceimpl<'a> RangePositioner<char, &'a str> for SourcePosition
impl<'a> RangePositioner<char, &'a str> for SourcePosition
sourcefn update_range(&mut self, range: &&'a str)
fn update_range(&mut self, range: &&'a str)
Updates the position given that range
has been taken from the stream
impl Copy for SourcePosition
impl Eq for SourcePosition
impl StructuralEq for SourcePosition
impl StructuralPartialEq for SourcePosition
Auto Trait Implementations
impl RefUnwindSafe for SourcePosition
impl Send for SourcePosition
impl Sync for SourcePosition
impl Unpin for SourcePosition
impl UnwindSafe for SourcePosition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more