Struct symbolic_sourcemap::SourceMapView
source · pub struct SourceMapView { /* private fields */ }
Expand description
Represents a source map.
Implementations
sourceimpl SourceMapView
impl SourceMapView
sourcepub fn from_json_slice(
buffer: &[u8]
) -> Result<SourceMapView, ParseSourceMapError>
pub fn from_json_slice(
buffer: &[u8]
) -> Result<SourceMapView, ParseSourceMapError>
Constructs a sourcemap from a slice.
If the sourcemap is an index it is being flattened. If flattening is not possible then an error is raised.
sourcepub fn lookup_token(&self, line: u32, col: u32) -> Option<TokenMatch<'_>>
pub fn lookup_token(&self, line: u32, col: u32) -> Option<TokenMatch<'_>>
Looks up a token and returns it.
sourcepub fn get_token(&self, idx: u32) -> Option<TokenMatch<'_>>
pub fn get_token(&self, idx: u32) -> Option<TokenMatch<'_>>
Returns a token for a specific index.
sourcepub fn get_token_count(&self) -> u32
pub fn get_token_count(&self) -> u32
Returns the number of tokens.
sourcepub fn get_source_view(&self, idx: u32) -> Option<&SourceView<'_>>
pub fn get_source_view(&self, idx: u32) -> Option<&SourceView<'_>>
Returns a source view for the given source.
sourcepub fn get_source_name(&self, idx: u32) -> Option<&str>
pub fn get_source_name(&self, idx: u32) -> Option<&str>
Returns the source name for an index.
sourcepub fn get_source_count(&self) -> u32
pub fn get_source_count(&self) -> u32
Returns the number of sources.
sourcepub fn lookup_token_with_function_name<'a, 'b>(
&'a self,
line: u32,
col: u32,
minified_name: &str,
source: &SourceView<'b>
) -> Option<TokenMatch<'a>>
pub fn lookup_token_with_function_name<'a, 'b>(
&'a self,
line: u32,
col: u32,
minified_name: &str,
source: &SourceView<'b>
) -> Option<TokenMatch<'a>>
Looks up a token and the original function name.
This is similar to lookup_token
but if a minified function name and
the sourceview to the minified source is available this function will
also resolve the original function name. This is used to fully
resolve tracebacks.
Auto Trait Implementations
impl !RefUnwindSafe for SourceMapView
impl !Send for SourceMapView
impl !Sync for SourceMapView
impl Unpin for SourceMapView
impl UnwindSafe for SourceMapView
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more