Trait Rule

Source
pub trait Rule<E>: Debug + Sync {
    // Required methods
    fn code(&self) -> Code;
    fn tags(&self) -> TagSet;
    fn body(&self) -> &'static str;
    fn check(&self, tree: E) -> Result;

    // Provided method
    fn name(&self) -> String { ... }
}
Expand description

A lint rule.

Required Methods§

Source

fn code(&self) -> Code

Get the code for this lint rule.

Source

fn tags(&self) -> TagSet

Get the lint tags for this lint rule.

Source

fn body(&self) -> &'static str

Get the body of the lint rule.

Source

fn check(&self, tree: E) -> Result

Checks the tree according to the implemented lint rule.

Provided Methods§

Source

fn name(&self) -> String

The name of the lint rule.

Implementors§