[][src]Struct rslint_core::RuleCtx

pub struct RuleCtx {
    pub file_id: usize,
    pub verbose: bool,
    pub diagnostics: Vec<Diagnostic>,
}

Context given to a rule when running it.

Fields

file_id: usize

The file id of the file being linted.

verbose: bool

Whether the linter is run with the --verbose option. Which dictates whether the linter should include more (potentially spammy) context in diagnostics.

diagnostics: Vec<Diagnostic>

An empty vector of diagnostics which the rule adds to.

Implementations

impl RuleCtx[src]

pub fn err(
    &mut self,
    code: impl AsRef<str>,
    message: impl AsRef<str>
) -> DiagnosticBuilder
[src]

Make a new diagnostic builder.

pub fn add_err(&mut self, diagnostic: impl Into<Diagnostic>)[src]

Trait Implementations

impl Clone for RuleCtx[src]

impl Debug for RuleCtx[src]

Auto Trait Implementations

impl RefUnwindSafe for RuleCtx

impl Send for RuleCtx

impl Sync for RuleCtx

impl Unpin for RuleCtx

impl UnwindSafe for RuleCtx

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> 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.