pub trait Rule:
Debug
+ 'static
+ Send
+ Sync {
Show 14 methods
// Required methods
fn load_from_config(
&self,
_config: &HashMap<String, Value>,
) -> Result<ErasedRule, String>;
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn long_description(&self) -> &'static str;
fn groups(&self) -> &'static [RuleGroups];
fn eval(&self, rule_cx: &RuleContext<'_>) -> Vec<LintResult>;
fn crawl_behaviour(&self) -> Crawler;
// Provided methods
fn lint_phase(&self) -> LintPhase { ... }
fn config_ref(&self) -> &'static str { ... }
fn force_enable(&self) -> bool { ... }
fn dialect_skip(&self) -> &'static [DialectKind] { ... }
fn code(&self) -> &'static str { ... }
fn is_fix_compatible(&self) -> bool { ... }
fn targets_templated(&self) -> bool { ... }
}Required Methods§
fn load_from_config( &self, _config: &HashMap<String, Value>, ) -> Result<ErasedRule, String>
fn name(&self) -> &'static str
fn description(&self) -> &'static str
fn long_description(&self) -> &'static str
Sourcefn groups(&self) -> &'static [RuleGroups]
fn groups(&self) -> &'static [RuleGroups]
All the groups this rule belongs to, including ‘all’ because that is a given. There should be no duplicates and ‘all’ should be the first element.
fn eval(&self, rule_cx: &RuleContext<'_>) -> Vec<LintResult>
fn crawl_behaviour(&self) -> Crawler
Provided Methods§
fn lint_phase(&self) -> LintPhase
fn config_ref(&self) -> &'static str
fn force_enable(&self) -> bool
Sourcefn dialect_skip(&self) -> &'static [DialectKind]
fn dialect_skip(&self) -> &'static [DialectKind]
Returns the set of dialects for which a particular rule should be skipped.
fn code(&self) -> &'static str
fn is_fix_compatible(&self) -> bool
Sourcefn targets_templated(&self) -> bool
fn targets_templated(&self) -> bool
Whether this rule is designed to operate on template-generated regions.
When false (the default) and ignore_templated_areas is enabled, any
lint result whose anchor falls in a non-literal (templated) section is
suppressed, matching SQLFluff’s behaviour.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".