pub trait Rule:
Any
+ Send
+ Sync {
Show 13 methods
// Required methods
fn evaluate(&self, context: &RuleContext) -> RuleResult;
fn priority(&self) -> u8;
fn description(&self) -> String;
fn state(&self) -> RuleState;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
// Provided methods
fn is_active(&self) -> bool { ... }
fn activate(&mut self) { ... }
fn is_relaxable(&self) -> bool { ... }
fn deactivate(&mut self) { ... }
fn relax(&mut self) { ... }
fn reset(&mut self) { ... }
fn delay(&self) -> u8 { ... }
}Expand description
A condition checked at every node of the search.
Required Methods§
Sourcefn evaluate(&self, context: &RuleContext) -> RuleResult
fn evaluate(&self, context: &RuleContext) -> RuleResult
Decides whether the search continues below the node.
Sourcefn description(&self) -> String
fn description(&self) -> String
A short human-readable name.
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Upcast used by RuleManager::get_rule_mut.
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Mutable upcast used by RuleManager::get_rule_mut.
Provided Methods§
Sourcefn is_relaxable(&self) -> bool
fn is_relaxable(&self) -> bool
Whether the rule restricts the search only temporarily. A search whose pass was cut by a relaxable rule is not finished.
Sourcefn deactivate(&mut self)
fn deactivate(&mut self)
Stops applying the rule.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".