pub struct SourceMap { /* private fields */ }Implementations§
Source§impl SourceMap
impl SourceMap
pub fn new() -> Self
Sourcepub fn add_file(
&mut self,
name: impl Into<String>,
src: impl Into<String>,
) -> Arc<SourceFile> ⓘ
pub fn add_file( &mut self, name: impl Into<String>, src: impl Into<String>, ) -> Arc<SourceFile> ⓘ
Adds a file after all existing ones. A one-byte gap is left between files so that the end-of-file position of one is not the start of the next.
pub fn files(&self) -> &[Arc<SourceFile>]
Sourcepub fn lookup_file(&self, pos: usize) -> &Arc<SourceFile> ⓘ
pub fn lookup_file(&self, pos: usize) -> &Arc<SourceFile> ⓘ
The file containing global position pos.
Sourcepub fn describe_pos(&self, span: Span) -> String
pub fn describe_pos(&self, span: Span) -> String
name:line:col for the start of span.
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 UnsafeUnpin 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