Skip to main content

Linter

Trait Linter 

Source
pub trait Linter: LSend {
    // Required methods
    fn lint(&mut self, document: &Document) -> Vec<Lint>;
    fn description(&self) -> &str;
}
Expand description

A stateless rule that searches documents for grammatical errors.

Commonly implemented via ExprLinter.

See also: LintGroup.

Required Methods§

Source

fn lint(&mut self, document: &Document) -> Vec<Lint>

Analyzes a document and produces zero or more Lints. We pass self mutably for caching purposes.

Source

fn description(&self) -> &str

A user-facing description of what kinds of grammatical errors this rule looks for. It is usually shown in settings menus.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Linter for LintGroup

Source§

impl Linter for WeirLinter

Source§

impl<L, U> Linter for L
where L: ExprLinter<Unit = U>, U: DocumentIterator,