pub struct RuleSet<'a> {
pub name: &'a str,
pub solver_families: &'a [SolverFamily],
/* private fields */
}Expand description
A structure representing a set of rules with a name, priority, and dependencies.
RuleSet is a way to group related rules together under a single name.
You can think of it like a list of rules that belong to the same category.
Each RuleSet can also have a number that tells it what order it should run in compared to other RuleSet instances.
Additionally, a RuleSet can depend on other RuleSet instances, meaning it needs them to run first.
To make things efficient, RuleSet only figures out its rules and dependencies the first time they’re needed,
and then it remembers them so it doesn’t have to do the work again.
§Fields
name: The name of the rule set.order: A number that decides the order in which thisRuleSetshould be applied. If twoRuleSetinstances have the same rule but with different priorities, the one with the higherordernumber will be the one that is used.rules: A lazily initialized map of rules to their priorities.dependency_rs_names: The names of the rule sets that this rule set depends on.dependencies: A lazily initialized set ofRuleSetdependencies.solver_families: The solver families that this rule set applies to.
Fields§
§name: &'a strThe name of the rule set.
solver_families: &'a [SolverFamily]The solver families that this rule set applies to.
Implementations§
Source§impl<'a> RuleSet<'a>
impl<'a> RuleSet<'a>
pub const fn new( name: &'a str, dependencies: &'a [&'a str], solver_families: &'a [SolverFamily], ) -> RuleSet<'a>
Sourcepub fn get_rules(&self) -> &HashMap<&'a Rule<'a>, u16>
pub fn get_rules(&self) -> &HashMap<&'a Rule<'a>, u16>
Get the rules of this rule set, evaluating them lazily if necessary
Returns a &HashMap<&Rule, u16> where the key is the rule and the value is the priority of the rule.
Sourcepub fn get_dependencies(&self) -> &HashSet<&'static RuleSet<'_>>
pub fn get_dependencies(&self) -> &HashSet<&'static RuleSet<'_>>
Get the dependencies of this rule set, evaluating them lazily if necessary
Returns a &HashSet<&RuleSet> of the rule sets that this rule set depends on.
Sourcepub fn with_dependencies(&self) -> HashSet<&'static RuleSet<'_>>
pub fn with_dependencies(&self) -> HashSet<&'static RuleSet<'_>>
Get the dependencies of this rule set, including itself
Trait Implementations§
impl Eq for RuleSet<'_>
Auto Trait Implementations§
impl<'a> !Freeze for RuleSet<'a>
impl<'a> RefUnwindSafe for RuleSet<'a>
impl<'a> Send for RuleSet<'a>
impl<'a> Sync for RuleSet<'a>
impl<'a> Unpin for RuleSet<'a>
impl<'a> UnwindSafe for RuleSet<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 160 bytes