Struct source_map::SourceMapBuilder
source · pub struct SourceMapBuilder { /* private fields */ }
Expand description
Struct for building a source map (v3)
Implementations§
source§impl SourceMapBuilder
impl SourceMapBuilder
pub fn new() -> SourceMapBuilder
pub fn add_new_line(&mut self)
pub fn add_to_column(&mut self, length: usize)
sourcepub fn add_mapping(
&mut self,
source_position: &SpanWithSource,
current_column: u32
)
pub fn add_mapping( &mut self, source_position: &SpanWithSource, current_column: u32 )
Original line and original column are one indexed
sourcepub fn build(self, fs: &impl FileSystem) -> SourceMap
pub fn build(self, fs: &impl FileSystem) -> SourceMap
Encodes the results into a string and builds the JSON representation thingy
TODO not 100% certain that this code is a the correct implementation
TODO are the accounts for SourceId::null valid here…?
Trait Implementations§
source§impl Default for SourceMapBuilder
impl Default for SourceMapBuilder
source§fn default() -> SourceMapBuilder
fn default() -> SourceMapBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SourceMapBuilder
impl RefUnwindSafe for SourceMapBuilder
impl Send for SourceMapBuilder
impl Sync for SourceMapBuilder
impl Unpin for SourceMapBuilder
impl UnwindSafe for SourceMapBuilder
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