pub struct SourcePosition {
pub index: usize,
pub line: usize,
pub column: usize,
}Expand description
Represents a position in source text.
Fields§
§index: usizeThe 0-based index of the character in the input stream.
line: usizeThe 1-based line number.
column: usizeThe 1-based column number.
Implementations§
Source§impl SourcePosition
impl SourcePosition
Sourcepub const fn offset(&self, offset: &SourcePositionOffset) -> Self
pub const fn offset(&self, offset: &SourcePositionOffset) -> Self
Returns a new SourcePosition offset by the given SourcePositionOffset.
§Arguments
offset- The offset to apply.
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 Default for SourcePosition
impl Default for SourcePosition
Source§fn default() -> SourcePosition
fn default() -> SourcePosition
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SourcePosition
impl RefUnwindSafe for SourcePosition
impl Send for SourcePosition
impl Sync for SourcePosition
impl Unpin for SourcePosition
impl UnsafeUnpin 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