Struct symbolic_sourcemap::SourceView[][src]

pub struct SourceView<'a> { /* fields omitted */ }

Represents JS source code.

Implementations

impl<'a> SourceView<'a>[src]

pub fn new(source: &'a str) -> Self[src]

Creates a view from a string.

pub fn from_string(source: String) -> Self[src]

Creates a view from a string.

pub fn from_slice(source: &'a [u8]) -> Self[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.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.