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