Trait pact_matching::MatchingContext
source · pub trait MatchingContext: Debug {
// Required methods
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<CommonMismatch>>;
fn plugin_configuration(&self) -> &HashMap<String, PluginInteractionConfig>;
fn matchers(&self) -> &MatchingRuleCategory;
fn config(&self) -> DiffConfig;
fn clone_with(
&self,
matchers: &MatchingRuleCategory
) -> Box<dyn MatchingContext + Send + Sync>;
}
Expand description
Context used to apply matching logic
Required Methods§
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn direct_matcher_defined(
&self,
path: &DocPath,
matchers: &HashSet<&str>
) -> bool
fn direct_matcher_defined( &self, path: &DocPath, matchers: &HashSet<&str> ) -> bool
If a matcher defined at the path (ignoring parents)
sourcefn match_keys(
&self,
path: &DocPath,
expected: &BTreeSet<String>,
actual: &BTreeSet<String>
) -> Result<(), Vec<CommonMismatch>>
fn match_keys( &self, path: &DocPath, expected: &BTreeSet<String>, actual: &BTreeSet<String> ) -> Result<(), Vec<CommonMismatch>>
Matches the keys of the expected and actual maps
sourcefn plugin_configuration(&self) -> &HashMap<String, PluginInteractionConfig>
fn plugin_configuration(&self) -> &HashMap<String, PluginInteractionConfig>
Returns the plugin configuration associated with the context
sourcefn matchers(&self) -> &MatchingRuleCategory
fn matchers(&self) -> &MatchingRuleCategory
Returns the matching rules for the matching context
sourcefn config(&self) -> DiffConfig
fn config(&self) -> DiffConfig
Configuration to apply when matching with the context
sourcefn clone_with(
&self,
matchers: &MatchingRuleCategory
) -> Box<dyn MatchingContext + Send + Sync>
fn clone_with( &self, matchers: &MatchingRuleCategory ) -> Box<dyn MatchingContext + Send + Sync>
Clones the current context with the provided matching rules