pub struct BaseSpan {
pub start: usize,
pub end: usize,
}Expand description
A byte-offset range in source text.
Spans are Copy and cheap to pass around. Use Span::merge to combine
spans when building compound expressions.
Fields§
§start: usizeByte offset of the first character (inclusive).
end: usizeByte offset past the last character (exclusive).
Implementations§
Source§impl Span
impl Span
Sourcepub fn new(start: usize, end: usize) -> Span
pub fn new(start: usize, end: usize) -> Span
Creates a span from byte offsets.
No validation is performed; start may exceed end.
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