pub struct Span {
pub offset: usize,
pub len: usize,
}Expand description
A byte offset and length in the input, for error reporting.
Span tracks the location of errors within the original input string,
enabling precise error messages for diagnostic tools.
use pkgsrc_kv::Span;
let span = Span { offset: 10, len: 5 };
let range: std::ops::Range<usize> = span.into();
assert_eq!(range, 10..15);Fields§
§offset: usizeByte offset where this span starts.
len: usizeLength in bytes.
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