pub struct Span { /* private fields */ }Expand description
A range of text within a CodeMap.
Implementations§
Source§impl Span
impl Span
Sourcepub const fn subspan(&self, begin: u64, end: u64) -> Span
pub const fn subspan(&self, begin: u64, end: u64) -> Span
Makes a span from offsets relative to the start of this span.
§Panics
- If
end < begin - If
endis beyond the length of the span
Sourcepub const fn contains(&self, other: Span) -> bool
pub const fn contains(&self, other: Span) -> bool
Checks if a span is contained within this span.
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