pub struct SourcePosition {
pub line: i32,
pub column: i32,
}
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§
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 Default for SourcePosition
impl Default for SourcePosition
Source§impl Display for SourcePosition
impl Display 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 Positioner<char> for SourcePosition
impl Positioner<char> for SourcePosition
Source§impl<'a> RangePositioner<char, &'a str> for SourcePosition
impl<'a> RangePositioner<char, &'a str> for SourcePosition
Source§fn 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 streamSource§impl Resetable for SourcePosition
impl Resetable for SourcePosition
type Checkpoint = SourcePosition
fn checkpoint(&self) -> Self
fn reset(&mut self, checkpoint: Self)
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more