Skip to main content

Rule

Trait Rule 

Source
pub trait Rule {
    // Required methods
    fn name(&self) -> &'static str;
    fn check(&self, file: &SourceFile) -> Vec<Offence>;
    fn check_workspace(&self, files: &[SourceFile]) -> Vec<Offence>;
    fn is_configured(&self) -> bool;
    fn requirement(&self) -> Option<&'static str>;
    fn explanation(&self) -> RuleExplanation;
}

Required Methods§

Source

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

Source

fn check(&self, file: &SourceFile) -> Vec<Offence>

Source

fn check_workspace(&self, files: &[SourceFile]) -> Vec<Offence>

Source

fn is_configured(&self) -> bool

Source

fn requirement(&self) -> Option<&'static str>

Source

fn explanation(&self) -> RuleExplanation

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§