Struct source_map::BaseSpan
source · pub struct BaseSpan<T: 'static> {
pub start: u32,
pub end: u32,
pub source: T,
}
Expand description
A start and end. Also contains trace of original source (depending on T
)
Fields§
§start: u32
§end: u32
§source: T
Implementations§
source§impl BaseSpan<()>
impl BaseSpan<()>
sourcepub fn is_adjacent_to(&self, other: impl Into<Start>) -> bool
pub fn is_adjacent_to(&self, other: impl Into<Start>) -> bool
Returns whether the end of self
is the start of other
sourcepub fn union(&self, end: impl Into<End>) -> Span
pub fn union(&self, end: impl Into<End>) -> Span
Returns a new Span
which starts at the start of self
a ends at the end of other
pub fn get_end(&self) -> End
pub fn get_start(&self) -> Start
pub fn with_source(self, source: SourceId) -> SpanWithSource
source§impl BaseSpan<SourceId>
impl BaseSpan<SourceId>
pub fn get_start(&self) -> Position
pub fn get_end(&self) -> Position
pub fn into_line_column_span<T: StringEncoding>( self, fs: &impl FileSystem ) -> LineColumnSpan<T>
pub fn without_source(self) -> Span
Trait Implementations§
source§impl<T: PartialEq + 'static> PartialEq for BaseSpan<T>
impl<T: PartialEq + 'static> PartialEq for BaseSpan<T>
impl<T: Copy + 'static> Copy for BaseSpan<T>
impl<T: Eq + 'static> Eq for BaseSpan<T>
impl<T: 'static> StructuralPartialEq for BaseSpan<T>
Auto Trait Implementations§
impl<T> Freeze for BaseSpan<T>where
T: Freeze,
impl<T> RefUnwindSafe for BaseSpan<T>where
T: RefUnwindSafe,
impl<T> Send for BaseSpan<T>where
T: Send,
impl<T> Sync for BaseSpan<T>where
T: Sync,
impl<T> Unpin for BaseSpan<T>where
T: Unpin,
impl<T> UnwindSafe for BaseSpan<T>where
T: UnwindSafe,
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