[−][src]Struct sourcemap::SourceView
Provides efficient access to minified sources.
This type is used to implement farily efficient source mapping operations.
Methods
impl<'a> SourceView<'a>
[src]
pub fn new(source: &'a str) -> SourceView<'a>
[src]
Creates an optimized view of a given source.
pub fn from_string(source: String) -> SourceView<'static>
[src]
Creates an optimized view from a given source string
pub fn get_line(&self, idx: u32) -> Option<&str>
[src]
Returns a requested minified line.
pub fn get_line_slice(&self, line: u32, col: u32, span: u32) -> Option<&str>
[src]
Returns a line slice.
Note that columns are indexed as JavaScript WTF-16 columns.
pub fn lines(&'a self) -> Lines<'a>
[src]
Returns an iterator over all lines.
pub fn source(&self) -> &str
[src]
Returns the source.
pub fn get_original_function_name<'map>(
&self,
token: Token<'map>,
minified_name: &str
) -> Option<&'map str>
[src]
&self,
token: Token<'map>,
minified_name: &str
) -> Option<&'map str>
Given a token and minified function name this attemps to resolve the name to an original function name.
This invokes some guesswork and requires access to the original minified source. This will not yield proper results for anonymous functions or functions that do not have clear function names. (For instance it's recommended that dotted function names are not passed to this function).
pub fn line_count(&self) -> usize
[src]
Returns the number of lines.
Trait Implementations
impl<'a> Clone for SourceView<'a>
[src]
fn clone(&self) -> SourceView<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for SourceView<'a>
[src]
Auto Trait Implementations
impl<'a> !Send for SourceView<'a>
impl<'a> !Sync for SourceView<'a>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,