#[non_exhaustive]pub struct Span {
pub start_line: usize,
pub start_column: usize,
pub start_offset: usize,
pub end_line: usize,
pub end_column: usize,
pub end_offset: usize,
}Expand description
A span of the source: 1-based lines and columns, 0-based byte offsets and an exclusive end. Columns count code points, and only a line feed starts a new line.
let refusals = statifier::compile("<scxml").unwrap_err();
let span = refusals[0].span();
assert_eq!((span.start_line, span.start_column), (1, 7));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.start_line: usizeThe line the span starts on.
start_column: usizeThe column, in code points, the span starts at.
start_offset: usizeThe byte offset the span starts at.
end_line: usizeThe line the span ends on.
end_column: usizeThe column the span ends at.
end_offset: usizeThe byte offset just past the span.
Trait Implementations§
impl Copy for Span
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Forget for Span
impl Freeze for Span
impl Move 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