Struct symbolic_sourcemap::SourceView
source · pub struct SourceView<'a> { /* private fields */ }
Expand description
Represents JS source code.
Implementations§
source§impl<'a> SourceView<'a>
impl<'a> SourceView<'a>
sourcepub fn new(source: &'a str) -> SourceView<'a>
pub fn new(source: &'a str) -> SourceView<'a>
Returns a view from a given source string.
sourcepub fn from_string(source: String) -> SourceView<'static>
pub fn from_string(source: String) -> SourceView<'static>
Creates a view from a string.
sourcepub fn from_bytes(source: &'a [u8]) -> SourceView<'a>
pub fn from_bytes(source: &'a [u8]) -> SourceView<'a>
Creates a soruce view from bytes ignoring utf-8 errors.
sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Returns the number of lines.