[][src]Struct pact_matching::models::matchingrules::MatchingRules

pub struct MatchingRules {
    pub rules: HashMap<String, Category>,
}

Data structure for representing a collection of matchers

Fields

rules: HashMap<String, Category>

Categories of matching rules

Implementations

impl MatchingRules[src]

pub fn is_empty(&self) -> bool[src]

If the matching rules are empty (that is there are no rules assigned to any categories)

pub fn is_not_empty(&self) -> bool[src]

If the matching rules are not empty (that is there is at least one rule assigned to a category)

pub fn add_category<S>(&mut self, category: S) -> &mut Category where
    S: Into<String>, 
[src]

Adds the category to the map of rules

pub fn categories(&self) -> HashSet<String>[src]

Returns all the category names in this rule set

pub fn rules_for_category(&self, category: &String) -> Option<Category>[src]

Returns the category of rules for a given category name

pub fn matcher_is_defined(&self, category: &str, path: &Vec<String>) -> bool[src]

If there is a matcher defined for the category and path

pub fn wildcard_matcher_is_defined(
    &self,
    category: &str,
    path: &Vec<String>
) -> bool
[src]

If there is a wildcard matcher defined for the category and path

pub fn resolve_matchers(
    &self,
    category: &str,
    path: &Vec<String>
) -> Option<Category>
[src]

Returns a Category filtered with all rules that match the given path.

pub fn resolve_body_matchers_by_path(
    &self,
    path: &Vec<String>
) -> Option<RuleList>
[src]

Returns a list of rules from the body category that match the given path

Trait Implementations

impl Clone for MatchingRules[src]

impl Debug for MatchingRules[src]

impl Default for MatchingRules[src]

impl<'de> Deserialize<'de> for MatchingRules[src]

impl Eq for MatchingRules[src]

impl Hash for MatchingRules[src]

impl PartialEq<MatchingRules> for MatchingRules[src]

impl Serialize for MatchingRules[src]

impl StructuralEq for MatchingRules[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any