pub trait BatchRule: Send + Sync {
// Required methods
fn id(&self) -> RuleId;
fn default_severity(&self) -> Severity;
fn description(&self) -> &'static str;
fn fix_hint(&self) -> &'static str;
fn run_batch(
&self,
docs: &[ParsedDocument],
ctx: &RuleContext<'_>,
) -> Vec<Violation>;
// Provided method
fn applies_to(&self, file_type: FileType) -> bool { ... }
}Expand description
Trait implemented by rules that need the full corpus at once (cross-file consistency checks).
Required Methods§
Sourcefn default_severity(&self) -> Severity
fn default_severity(&self) -> Severity
Severity when no config override applies.
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
One-line human description of what the rule enforces.
Sourcefn run_batch(
&self,
docs: &[ParsedDocument],
ctx: &RuleContext<'_>,
) -> Vec<Violation>
fn run_batch( &self, docs: &[ParsedDocument], ctx: &RuleContext<'_>, ) -> Vec<Violation>
Inspect the whole corpus at once and return any findings.
Provided Methods§
Sourcefn applies_to(&self, file_type: FileType) -> bool
fn applies_to(&self, file_type: FileType) -> bool
Filter applied to each document before the batch rule sees it. Defaults to “AI guidance files only”.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".