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 moreAuto Trait Implementations§
impl Freeze for SourceMapSection
impl !RefUnwindSafe for SourceMapSection
impl !Send for SourceMapSection
impl !Sync for SourceMapSection
impl Unpin for SourceMapSection
impl UnwindSafe for SourceMapSection
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)