pub struct SpanMap { /* private fields */ }Expand description
Map from dotted field path to source span. Built by the saphyr parser;
consumed by diagnose_resource_with_spans (Task 4) to attach positions
to diagnostics.
Implementations§
Source§impl SpanMap
impl SpanMap
Sourcepub fn new(file: PathBuf) -> Self
pub fn new(file: PathBuf) -> Self
Create a new SpanMap associated with the given source file path.
Sourcepub fn insert(
&mut self,
path: impl Into<String>,
line: u32,
col: u32,
end_line: u32,
end_col: u32,
)
pub fn insert( &mut self, path: impl Into<String>, line: u32, col: u32, end_line: u32, end_col: u32, )
Insert a span for the given dotted path.
Lines and columns are 1-indexed; end_col is exclusive.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpanMap
impl RefUnwindSafe for SpanMap
impl Send for SpanMap
impl Sync for SpanMap
impl Unpin for SpanMap
impl UnsafeUnpin for SpanMap
impl UnwindSafe for SpanMap
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more