pub struct Span {
pub start: u32,
pub end: u32,
}Expand description
A byte range in the source text.
Spans use byte offsets (not character offsets) for efficiency.
Both start and end are inclusive-exclusive: [start, end).
§Example
use litedoc_core::span::Span;
let span = Span::new(0, 10);
assert_eq!(span.len(), 10);Fields§
§start: u32Starting byte offset (inclusive).
end: u32Ending byte offset (exclusive).
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 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