pub trait Rule: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn description(&self) -> &'static str;
fn explanation(&self) -> &'static str;
fn examples(&self) -> &'static [Example];
fn exceptable_nodes(&self) -> Option<&'static [SyntaxKind]>;
fn deny(&mut self);
fn severity(&self) -> Severity;
}Expand description
A trait implemented by analysis rules.
Required Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
The unique identifier for the rule.
The identifier is required to be pascal case and it is the identifier by which a rule is excepted or denied.
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
A short, single sentence description of the rule.
Sourcefn explanation(&self) -> &'static str
fn explanation(&self) -> &'static str
Get the long-form explanation of the rule.
Sourcefn exceptable_nodes(&self) -> Option<&'static [SyntaxKind]>
fn exceptable_nodes(&self) -> Option<&'static [SyntaxKind]>
Gets the nodes that are exceptable for this rule.
If None is returned, all nodes are exceptable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".