pub struct SourceMap { /* private fields */ }Expand description
Implementations§
Source§impl SourceMap
impl SourceMap
Sourcepub fn add(&mut self, name: SourceName, text: String) -> FileId
pub fn add(&mut self, name: SourceName, text: String) -> FileId
Sourcepub fn file(&self, id: FileId) -> &SourceFile
pub fn file(&self, id: FileId) -> &SourceFile
Sourcepub fn get(&self, id: FileId) -> Option<&SourceFile>
pub fn get(&self, id: FileId) -> Option<&SourceFile>
Returns the file id names, or None when it came from another map.
Sourcepub fn line_col(&self, span: Span) -> LineCol
pub fn line_col(&self, span: Span) -> LineCol
Returns the one-based line and column span starts at.
§Panics
Panics when span names a file of another map.
Sourcepub fn iter(&self) -> impl Iterator<Item = &SourceFile>
pub fn iter(&self) -> impl Iterator<Item = &SourceFile>
Returns every file, in the order they were added.
Trait Implementations§
Auto Trait Implementations§
impl Forget for SourceMap
impl Freeze for SourceMap
impl Move for SourceMap
impl RefUnwindSafe for SourceMap
impl Send for SourceMapwhere
RawVecInner: Send,
impl Sync for SourceMapwhere
RawVecInner: Sync,
impl Unpin for SourceMap
impl UnsafeUnpin for SourceMapwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<SourceFile>: UnsafeUnpin,
PhantomData<fn(FileId)>: UnsafeUnpin,
impl UnwindSafe for SourceMapwhere
RawVecInner: 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