pub struct SourcePosition {
pub byte_offset: usize,
pub line: usize,
pub column: usize,
}Expand description
Represents a position in source text.
Fields§
§byte_offset: usizeThe 0-based byte offset in the input stream.
line: usizeThe 1-based line number.
column: usizeThe 1-based column number (character count within the line).
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§impl Debug for SourcePosition
impl Debug for SourcePosition
Source§impl Default for SourcePosition
impl Default for SourcePosition
Auto Trait Implementations§
impl Forget for SourcePosition
impl Freeze for SourcePosition
impl Move 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