pub struct RuleEngine { /* private fields */ }Expand description
Rule execution engine
Implementations§
Source§impl RuleEngine
impl RuleEngine
Sourcepub fn from_config(config: LintConfig) -> Self
pub fn from_config(config: LintConfig) -> Self
Create from a lint configuration
Sourcepub fn add_rules(&mut self, rules: impl IntoIterator<Item = Rule>)
pub fn add_rules(&mut self, rules: impl IntoIterator<Item = Rule>)
Add multiple rules
Sourcepub fn set_severity_threshold(&mut self, threshold: Severity)
pub fn set_severity_threshold(&mut self, threshold: Severity)
Set severity threshold
Sourcepub fn active_rules(&self) -> impl Iterator<Item = &Rule>
pub fn active_rules(&self) -> impl Iterator<Item = &Rule>
Get all active rules (respecting overrides)
Sourcepub fn effective_severity(&self, rule: &Rule) -> Severity
pub fn effective_severity(&self, rule: &Rule) -> Severity
Get effective severity for a rule (considering overrides)
Sourcepub fn execute_rule(&self, _rule: &Rule) -> Vec<MatchResult>
pub fn execute_rule(&self, _rule: &Rule) -> Vec<MatchResult>
Execute a rule and produce a MatchResult
Note: This is a placeholder that needs integration with ryo-analysis for actual AST matching. Currently returns the match result structure.
Sourcepub fn execute_all(&self) -> Vec<MatchResult>
pub fn execute_all(&self) -> Vec<MatchResult>
Execute all active rules
Sourcepub fn diagnostics_from_results<'a>(
&self,
results: impl IntoIterator<Item = &'a MatchResult>,
file_path: impl AsRef<Path>,
) -> Vec<Diagnostic>
pub fn diagnostics_from_results<'a>( &self, results: impl IntoIterator<Item = &'a MatchResult>, file_path: impl AsRef<Path>, ) -> Vec<Diagnostic>
Produce diagnostics from match results
Sourcepub fn process_result(&self, result: MatchResult, rule: &Rule) -> MatchResult
pub fn process_result(&self, result: MatchResult, rule: &Rule) -> MatchResult
Process a MatchResult through message interpolation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleEngine
impl RefUnwindSafe for RuleEngine
impl Send for RuleEngine
impl Sync for RuleEngine
impl Unpin for RuleEngine
impl UnsafeUnpin for RuleEngine
impl UnwindSafe for RuleEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more