[−][src]Enum sourcemap::DecodedMap
Represents the result of a decode operation
This represents either an actual sourcemap or a source map index. Usually the two things are too distinct to provide a common interface however for token lookup and writing back into a writer general methods are provided.
Variants
Regular(SourceMap)
Indicates a regular sourcemap
Index(SourceMapIndex)
Indicates a sourcemap index
Hermes(SourceMapHermes)
Indicates a sourcemap as generated by Metro+Hermes, as used by react-native
Implementations
impl DecodedMap
[src]
pub fn from_reader<R: Read>(rdr: R) -> Result<DecodedMap>
[src]
Alias for decode
.
pub fn to_writer<W: Write>(&self, w: W) -> Result<()>
[src]
Writes a decoded sourcemap to a writer.
pub fn lookup_token(&self, line: u32, col: u32) -> Option<Token>
[src]
Shortcut to look up a token on either an index or a regular sourcemap. This method can only be used if the contained index actually contains embedded maps or it will not be able to look up anything.
pub fn get_original_function_name(
&self,
line: u32,
col: u32,
minified_name: Option<&str>,
source_view: Option<&SourceView>
) -> Option<&str>
[src]
&self,
line: u32,
col: u32,
minified_name: Option<&str>,
source_view: Option<&SourceView>
) -> Option<&str>
Returns the original function name.
minified_name
and source_view
are not always necessary. For
instance hermes source maps can provide this information without
access to the original sources.
Trait Implementations
impl Clone for DecodedMap
[src]
fn clone(&self) -> DecodedMap
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DecodedMap
[src]
Auto Trait Implementations
impl !RefUnwindSafe for DecodedMap
impl !Send for DecodedMap
impl !Sync for DecodedMap
impl Unpin for DecodedMap
impl UnwindSafe for DecodedMap
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,