Trait pact_matching::MatchingContext [−][src]
pub trait MatchingContext {
fn matcher_is_defined(&self, path: &DocPath) -> bool;
fn select_best_matcher(&self, path: &DocPath) -> RuleList;
fn type_matcher_defined(&self, path: &DocPath) -> bool;
fn values_matcher_defined(&self, path: &DocPath) -> bool;
fn direct_matcher_defined(
&self,
path: &DocPath,
matchers: &HashSet<&str>
) -> bool;
fn match_keys(
&self,
path: &DocPath,
expected: &BTreeSet<String>,
actual: &BTreeSet<String>
) -> Result<(), Vec<Mismatch>>;
fn plugin_configuration(&self) -> &HashMap<String, PluginInteractionConfig>;
fn matchers(&self) -> &MatchingRuleCategory;
fn config(&self) -> DiffConfig;
fn clone_with(
&self,
matchers: &MatchingRuleCategory
) -> Box<dyn MatchingContext>;
}
Expand description
Context used to apply matching logic
Required methods
fn matcher_is_defined(&self, path: &DocPath) -> bool
fn matcher_is_defined(&self, path: &DocPath) -> bool
If there is a matcher defined at the path in this context
fn select_best_matcher(&self, path: &DocPath) -> RuleList
fn select_best_matcher(&self, path: &DocPath) -> RuleList
Selected the best matcher from the context for the given path
fn type_matcher_defined(&self, path: &DocPath) -> bool
fn type_matcher_defined(&self, path: &DocPath) -> bool
If there is a type matcher defined at the path in this context
fn values_matcher_defined(&self, path: &DocPath) -> bool
fn values_matcher_defined(&self, path: &DocPath) -> bool
If there is a values matcher defined at the path in this context
If a matcher defined at the path (ignoring parents)
Matches the keys of the expected and actual maps
fn plugin_configuration(&self) -> &HashMap<String, PluginInteractionConfig>
fn plugin_configuration(&self) -> &HashMap<String, PluginInteractionConfig>
Returns the plugin configuration associated with the context
fn matchers(&self) -> &MatchingRuleCategory
fn matchers(&self) -> &MatchingRuleCategory
Returns the matching rules for the matching context
fn config(&self) -> DiffConfig
fn config(&self) -> DiffConfig
Configuration to apply when matching with the context
fn clone_with(
&self,
matchers: &MatchingRuleCategory
) -> Box<dyn MatchingContext>
fn clone_with(
&self,
matchers: &MatchingRuleCategory
) -> Box<dyn MatchingContext>
Clones the current context with the provided matching rules