pub trait FieldValuesFilter<F: Field, V> {
// Required methods
fn matching_mode(&self) -> &MatchingMode;
fn match_one(&self, field: &F, value: &V) -> bool;
fn max_matches(&self) -> usize;
// Provided methods
fn matches<'a, I: Iterator<Item = (&'a F, &'a V)>>(
&'a self,
items: I,
) -> bool
where F: 'a,
V: 'a { ... }
fn match_all<'a, I: Iterator<Item = (&'a F, &'a V)>>(
&'a self,
items: I,
) -> bool
where F: 'a,
V: 'a { ... }
fn match_any<'a, I: Iterator<Item = (&'a F, &'a V)>>(
&'a self,
items: I,
) -> bool
where F: 'a,
V: 'a { ... }
fn match_none<'a, I: Iterator<Item = (&'a F, &'a V)>>(
&'a self,
items: I,
) -> bool
where F: 'a,
V: 'a { ... }
}Expand description
Filtering behavior that check some field value. Most methods have default implementations. By
implementing the matching_mode and match_one methods you should have a working
implementation. You can override the default implementations for efficiency if needed.
Required Methods§
Sourcefn matching_mode(&self) -> &MatchingMode
fn matching_mode(&self) -> &MatchingMode
Matching mode that determines how to match the field values.
Sourcefn max_matches(&self) -> usize
fn max_matches(&self) -> usize
Maximum number of fields to match.
Provided Methods§
Sourcefn matches<'a, I: Iterator<Item = (&'a F, &'a V)>>(&'a self, items: I) -> boolwhere
F: 'a,
V: 'a,
fn matches<'a, I: Iterator<Item = (&'a F, &'a V)>>(&'a self, items: I) -> boolwhere
F: 'a,
V: 'a,
Whether the given field and value satisfy this filter.
Sourcefn match_all<'a, I: Iterator<Item = (&'a F, &'a V)>>(&'a self, items: I) -> boolwhere
F: 'a,
V: 'a,
fn match_all<'a, I: Iterator<Item = (&'a F, &'a V)>>(&'a self, items: I) -> boolwhere
F: 'a,
V: 'a,
Check whether all filtering fields are a match.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.