pub enum DecodedMap {
Regular(SourceMap),
}Expand description
A unified type that can hold any decoded source map variant.
Dispatches lookups to the underlying type. Currently only supports
regular source maps; the Hermes variant will be added when the
hermes crate is integrated.
Variants§
Implementations§
Source§impl DecodedMap
impl DecodedMap
Sourcepub fn from_json(json: &str) -> Result<Self, ParseError>
pub fn from_json(json: &str) -> Result<Self, ParseError>
Parse a JSON string and auto-detect the source map type.
Sourcepub fn original_position_for(
&self,
line: u32,
column: u32,
) -> Option<OriginalLocation>
pub fn original_position_for( &self, line: u32, column: u32, ) -> Option<OriginalLocation>
Look up the original source position for a generated position (0-based).
Sourcepub fn generated_position_for(
&self,
source: &str,
line: u32,
column: u32,
) -> Option<GeneratedLocation>
pub fn generated_position_for( &self, source: &str, line: u32, column: u32, ) -> Option<GeneratedLocation>
Look up the generated position for an original source position (0-based).
Sourcepub fn set_debug_id(&mut self, id: impl Into<String>)
pub fn set_debug_id(&mut self, id: impl Into<String>)
Set the debug ID.
Sourcepub fn into_source_map(self) -> Option<SourceMap>
pub fn into_source_map(self) -> Option<SourceMap>
Extract the inner SourceMap if this is the Regular variant.
Auto Trait Implementations§
impl !Freeze for DecodedMap
impl !RefUnwindSafe for DecodedMap
impl Send for DecodedMap
impl !Sync for DecodedMap
impl Unpin for DecodedMap
impl UnsafeUnpin for DecodedMap
impl UnwindSafe for DecodedMap
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