pub trait VariantMatcher: Debug {
    // Required methods
    fn find_matching_variant(
        &self,
        value: &Value,
        variants: &Vec<(usize, MatchingRuleCategory, HashMap<DocPath, Generator>)>
    ) -> Option<(usize, HashMap<DocPath, Generator>)>;
    fn boxed(&self) -> Box<dyn VariantMatcher + Send + Sync>;
}
Expand description

Trait to represent matching logic to find a matching variant for the Array Contains generator

Required Methods§

source

fn find_matching_variant( &self, value: &Value, variants: &Vec<(usize, MatchingRuleCategory, HashMap<DocPath, Generator>)> ) -> Option<(usize, HashMap<DocPath, Generator>)>

Finds the matching variant for the given value

source

fn boxed(&self) -> Box<dyn VariantMatcher + Send + Sync>

Clones this matcher and returns it in a box

Implementors§