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§
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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".