[][src]Struct rslint_core::RuleCtx

pub struct RuleCtx {
    pub file_id: usize,
    pub verbose: bool,
    pub diagnostics: Vec<Diagnostic>,
    pub fixer: Option<Fixer>,
    pub src: Arc<String>,

Context given to a rule when running it.


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.

fixer: Option<Fixer>src: Arc<String>


impl RuleCtx[src]

pub fn err(
    &mut self,
    code: impl Into<String>,
    message: impl Into<String>
) -> Diagnostic

Make a new diagnostic builder.

pub fn add_err(&mut self, diagnostic: Diagnostic)[src]

pub fn fix(&mut self) -> &mut Fixer[src]

Make a new fixer for this context and return a mutable reference to it

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> DynClone for T where
    T: Clone

impl<T> Erasable for T

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.