pub struct Span {
pub start: usize,
pub end: usize,
}Expand description
Byte-offset span in the source expression used exclusively for error tracking and diagnostics.
Span carries source positions so that errors can point back at the
offending token, and offers richer error reporting.
§Note
Offsets are in bytes (not char indices), compatible with Rust’s
native &str slicing, and safe across Unicode content because the
tokenizer only records positions at char boundaries.
Fields§
§start: usizeInclusive start byte offset.
end: usizeExclusive end byte offset.
Implementations§
Trait Implementations§
impl Copy for Span
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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