pub trait Check: Sync {
// Required methods
fn name(&self) -> &str;
fn stage(&self) -> Stage;
fn scope(&self) -> Scope;
fn severity(&self) -> Severity;
fn run(&self, ctx: &Ctx<'_>) -> Outcome;
// Provided method
fn fix(&self) -> Fix { ... }
}Expand description
One check, whether compiled in or declared by the repository.
Sync because pre-commit hands every check to its own thread. Both
implementations satisfy it for free, and requiring it here is what lets the
dispatcher hold &'static dyn Check without caring which kind it has.
Required Methods§
fn name(&self) -> &str
fn stage(&self) -> Stage
fn scope(&self) -> Scope
fn severity(&self) -> Severity
fn run(&self, ctx: &Ctx<'_>) -> Outcome
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".