Struct js_source_scopes::NameResolver
source · pub struct NameResolver<'a, T> { /* private fields */ }
Expand description
A structure for resolving ScopeName
s in minified code to their original names
using information contained in a DecodedMap
.
Implementations
sourceimpl<'a, T: AsRef<str>> NameResolver<'a, T>
impl<'a, T: AsRef<str>> NameResolver<'a, T>
sourcepub fn new(ctx: &'a SourceContext<T>, sourcemap: &'a DecodedMap) -> Self
pub fn new(ctx: &'a SourceContext<T>, sourcemap: &'a DecodedMap) -> Self
Construct a new NameResolver
from a SourceContext
(for the minified source) and a DecodedMap
.
sourcepub fn resolve_name(&self, name: &ScopeName) -> String
pub fn resolve_name(&self, name: &ScopeName) -> String
Resolves the given minified ScopeName
to the original name.
This tries to resolve each NameComponent
by looking up its source
range in the DecodedMap
, using the token’s name
(as defined in the
sourcemap names
) when possible.
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for NameResolver<'a, T>
impl<'a, T> !Send for NameResolver<'a, T>
impl<'a, T> !Sync for NameResolver<'a, T>
impl<'a, T> Unpin for NameResolver<'a, T>
impl<'a, T> !UnwindSafe for NameResolver<'a, T>
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