pub struct SourceMap {
files: Vec<SourceFile>,
}Expand description
Registry of source files participating in a single compilation/run.
Diagnostics carry a FileId (via their Span); the renderer looks up the
file’s path and source via this map.
Fields§
§files: Vec<SourceFile>Implementations§
Source§impl SourceMap
impl SourceMap
pub fn new() -> Self
pub fn get(&self, file_id: FileId) -> Option<&SourceFile>
pub fn path_of(&self, file_id: FileId) -> Option<&Path>
pub fn source_of(&self, file_id: FileId) -> Option<&str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceMap
impl RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl UnwindSafe for SourceMap
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