Struct pact_models::matchingrules::RuleList
source · pub struct RuleList {
pub rules: Vec<MatchingRule>,
pub rule_logic: RuleLogic,
pub cascaded: bool,
}
Expand description
Data structure for representing a list of rules and the logic needed to combine them
Fields§
§rules: Vec<MatchingRule>
List of rules to apply
rule_logic: RuleLogic
Rule logic to use to evaluate multiple rules
cascaded: bool
If this rule list has matched the exact path or if it has cascaded (i.e. is a parent)
Implementations§
source§impl RuleList
impl RuleList
sourcepub fn new(rule: MatchingRule) -> RuleList
pub fn new(rule: MatchingRule) -> RuleList
Creates a new rule list with the single matching rule
sourcepub fn type_matcher_defined(&self) -> bool
pub fn type_matcher_defined(&self) -> bool
If there is a type matcher defined for the rule list
sourcepub fn values_matcher_defined(&self) -> bool
pub fn values_matcher_defined(&self) -> bool
If the values matcher is defined for the rule list
sourcepub fn add_rule(&mut self, rule: &MatchingRule)
pub fn add_rule(&mut self, rule: &MatchingRule)
Add a matching rule to the rule list
sourcepub fn as_cascaded(&self, b: bool) -> RuleList
pub fn as_cascaded(&self, b: bool) -> RuleList
If this rule list has matched the exact path or if it has cascaded (i.e. is a parent)
Trait Implementations§
source§impl PartialEq for RuleList
impl PartialEq for RuleList
impl Eq for RuleList
Auto Trait Implementations§
impl RefUnwindSafe for RuleList
impl Send for RuleList
impl Sync for RuleList
impl Unpin for RuleList
impl UnwindSafe for RuleList
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.