[][src]Struct rslint_core::RuleResult

pub struct RuleResult {
    pub diagnostics: Vec<Diagnostic>,
    pub fixer: Option<Fixer>,
}

The result of running a single rule on a syntax tree.

Fields

diagnostics: Vec<Diagnostic>fixer: Option<Fixer>

Implementations

impl RuleResult[src]

pub fn new(
    diagnostics: Vec<Diagnostic>,
    fixer: impl Into<Option<Fixer>>
) -> Self
[src]

Make a new rule result with diagnostics and an optional fixer.

pub fn outcome(&self) -> Outcome[src]

Get the result of running this rule.

pub fn merge(self, other: RuleResult) -> RuleResult[src]

Merge two results, this will join self and other's diagnostics and take self's fixer if available or otherwise take other's fixer

pub fn fix(&self) -> Option<String>[src]

Attempt to fix the issue if the rule can be autofixed.

Trait Implementations

impl Clone for RuleResult[src]

impl Debug for RuleResult[src]

Auto Trait Implementations

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.