Struct symbolic_sourcemap::SourceView
[−]
[src]
pub struct SourceView<'a> { /* fields omitted */ }
Represents JS sourcecode.
Methods
impl<'a> SourceView<'a>
[src]
pub fn new(source: &'a str) -> SourceView<'a>
[src]
Returns a view from a given source string.
pub fn from_string(source: String) -> SourceView<'static>
[src]
Creates a view from a string.
pub fn from_bytes(source: &'a [u8]) -> SourceView<'a>
[src]
Creates a soruce view from bytes ignoring utf-8 errors.
pub fn as_str(&self) -> &str
[src]
Returns the embedded source a string.
pub fn get_line(&self, idx: u32) -> Option<&str>
[src]
Returns a specific line.
pub fn line_count(&self) -> usize
[src]
Returns the number of lines.