[][src]Struct rslint_cli::JsFile

pub struct JsFile {
    pub source: String,
    pub name: String,
    pub path: Option<PathBuf>,
    pub id: usize,
    pub kind: JsFileKind,
    pub line_starts: Vec<usize>,
}

A structure representing either a concrete (in-disk) or virtual (temporary/non-disk) js or mjs file.

Fields

source: Stringname: String

The name of the file.

path: Option<PathBuf>

The path in disk if this is a concrete file.

id: usize

The codespan id assigned to this file used to refer back to it.

kind: JsFileKind

Whether this is a js or mjs file (script vs module).

line_starts: Vec<usize>

The cached line start locations in this file.

Implementations

impl JsFile[src]

pub fn new_concrete(source: String, path: PathBuf) -> Self[src]

pub fn update_src(&mut self, new: String)[src]

pub fn line_starts<'a>(source: &'a str) -> impl Iterator<Item = usize> + 'a[src]

pub fn line_start(&self, line_index: usize) -> Option<usize>[src]

pub fn line_index(&self, byte_index: usize) -> usize[src]

pub fn line_col_to_index(&self, line: usize, column: usize) -> Option<usize>[src]

Trait Implementations

impl Clone for JsFile[src]

impl Debug for JsFile[src]

impl Eq for JsFile[src]

impl Hash for JsFile[src]

impl PartialEq<JsFile> for JsFile[src]

impl StructuralEq for JsFile[src]

impl StructuralPartialEq for JsFile[src]

Auto Trait Implementations

impl RefUnwindSafe for JsFile

impl Send for JsFile

impl Sync for JsFile

impl Unpin for JsFile

impl UnwindSafe for JsFile

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> CallHasher for T where
    T: Hash

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> Erasable for T

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.