Struct sourcemap::SourceMapSection
source · pub struct SourceMapSection { /* private fields */ }
Expand description
Represents a section in a sourcemap index
Implementations§
source§impl SourceMapSection
impl SourceMapSection
sourcepub fn new(
offset: (u32, u32),
url: Option<String>,
map: Option<DecodedMap>
) -> SourceMapSection
pub fn new(
offset: (u32, u32),
url: Option<String>,
map: Option<DecodedMap>
) -> SourceMapSection
Create a new sourcemap index section
offset
: offset as line and columnurl
: optional URL of where the sourcemap is locatedmap
: an optional already resolved internal sourcemap
sourcepub fn get_offset_line(&self) -> u32
pub fn get_offset_line(&self) -> u32
Returns the offset line
sourcepub fn get_offset_col(&self) -> u32
pub fn get_offset_col(&self) -> u32
Returns the offset column
sourcepub fn get_offset(&self) -> (u32, u32)
pub fn get_offset(&self) -> (u32, u32)
Returns the offset as tuple
sourcepub fn get_sourcemap(&self) -> Option<&DecodedMap>
pub fn get_sourcemap(&self) -> Option<&DecodedMap>
Returns a reference to the embedded sourcemap if available
sourcepub fn get_sourcemap_mut(&mut self) -> Option<&mut DecodedMap>
pub fn get_sourcemap_mut(&mut self) -> Option<&mut DecodedMap>
Returns a reference to the embedded sourcemap if available
sourcepub fn set_sourcemap(&mut self, sm: Option<DecodedMap>)
pub fn set_sourcemap(&mut self, sm: Option<DecodedMap>)
Replaces the embedded sourcemap
Trait Implementations§
source§impl Clone for SourceMapSection
impl Clone for SourceMapSection
source§fn clone(&self) -> SourceMapSection
fn clone(&self) -> SourceMapSection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more