Skip to main content

Rule

Trait Rule 

Source
pub trait Rule: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn check(&self, content: &str, file_path: &Path) -> Vec<LintMessage>;

    // Provided methods
    fn code(&self) -> &str { ... }
    fn category(&self) -> &str { ... }
    fn description(&self) -> &str { ... }
    fn has_fix(&self) -> bool { ... }
    fn default_severity(&self) -> Severity { ... }
    fn url(&self) -> &str { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn check(&self, content: &str, file_path: &Path) -> Vec<LintMessage>

Provided Methods§

Source

fn code(&self) -> &str

Source

fn category(&self) -> &str

Source

fn description(&self) -> &str

Source

fn has_fix(&self) -> bool

Source

fn default_severity(&self) -> Severity

Source

fn url(&self) -> &str

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§