pub struct SourceMap { /* private fields */ }Expand description
Source map holding a list of mappings sorted by generated offset.
Implementations§
Source§impl SourceMap
impl SourceMap
pub fn new() -> Self
Sourcepub fn add_mapping(
&mut self,
generated_offset: u32,
source_file: &str,
source_line: u32,
source_col: u32,
name: Option<&str>,
)
pub fn add_mapping( &mut self, generated_offset: u32, source_file: &str, source_line: u32, source_col: u32, name: Option<&str>, )
Add a mapping entry.
Sourcepub fn lookup(&self, generated_offset: u32) -> Option<&SourceMapping>
pub fn lookup(&self, generated_offset: u32) -> Option<&SourceMapping>
Look up the source position for a generated offset.
pub fn mapping_count(&self) -> usize
pub fn source_file_count(&self) -> usize
pub fn source_files(&self) -> &[String]
pub fn is_empty(&self) -> bool
Sourcepub fn mappings_for_file(&self, file: &str) -> Vec<&SourceMapping>
pub fn mappings_for_file(&self, file: &str) -> Vec<&SourceMapping>
All mappings for a specific source file.
pub fn clear(&mut self)
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