pub struct Span { /* private fields */ }Implementations§
Source§impl Span
impl Span
Sourcepub fn contains(&self, loc: &Loc) -> bool
pub fn contains(&self, loc: &Loc) -> bool
returns whether this span contains the given Location
Sourcepub fn contains_span(&self, subspan: &Self) -> bool
pub fn contains_span(&self, subspan: &Self) -> bool
returns whether this span contains the given span
Sourcepub fn subspan<B: RangeBounds<u32>>(self, range: B) -> Self
pub fn subspan<B: RangeBounds<u32>>(self, range: B) -> Self
Sourcepub fn intersection(&self, with: &Self) -> Option<Self>
pub fn intersection(&self, with: &Self) -> Option<Self>
Sourcepub fn with_len(&self, len: u32) -> Self
pub fn with_len(&self, len: u32) -> Self
construct a Span starting where self starts, with the given length
Sourcepub fn same_buf_as(&self, loc: Loc) -> bool
pub fn same_buf_as(&self, loc: Loc) -> bool
returns whether both locations are in the same Buffer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SpannerExt for T
impl<T> SpannerExt for T
Source§fn spanned(self, span: Span) -> Spanned<Self>
fn spanned(self, span: Span) -> Spanned<Self>
helper extension method to quickly wrap values in
SpannedSource§fn src_spanned<Src: BufferSource>(
self,
src_span: SrcSpan<Src>,
) -> SrcSpanned<Self, Src>
fn src_spanned<Src: BufferSource>( self, src_span: SrcSpan<Src>, ) -> SrcSpanned<Self, Src>
helper extension method to quickly wrap values in
SrcSpanned