pub(super) trait TypedRule:
Send
+ Sync
+ 'static {
type Violation: TypedRuleViolation<Rule = Self> + FormattedRuleViolation + 'static;
// Required methods
fn code() -> &'static str;
fn check(&self, ctx: &FileContext<'_>) -> Vec<Self::Violation>;
}Expand description
Typed rule contract implemented by each concrete rule.
Keeping the associated violation here prevents a rule from returning the
violation type owned by another rule, while still allowing dyn Rule.
Required Associated Types§
type Violation: TypedRuleViolation<Rule = Self> + FormattedRuleViolation + 'static
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".