Struct symbolic_sourcemap::SourceView
source · pub struct SourceView<'a> { /* private fields */ }
Expand description
Represents JS source code.
Implementations
sourceimpl<'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.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for SourceView<'a>
impl<'a> !Send for SourceView<'a>
impl<'a> !Sync for SourceView<'a>
impl<'a> Unpin for SourceView<'a>
impl<'a> UnwindSafe for SourceView<'a>
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