pub trait Matcher<'a, T: 'a> {
// Required method
fn check(&self, actual: &'a T) -> MatchResult;
}Expand description
The trait which has to be implemented by all matchers.
Required Methods§
Sourcefn check(&self, actual: &'a T) -> MatchResult
fn check(&self, actual: &'a T) -> MatchResult
Checks the passed value if it satisfies the Matcher.
Values are always taken as immutable reference as the actual value shouldn’t be changed by the matcher.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<'a, K, V, M> Matcher<'a, M> for HasEntry<K, V>
impl<'a, K, V, M> Matcher<'a, M> for HasKey<K>
impl<'a, K, V, M> Matcher<'a, M> for HasValue<V>
impl<'a, T, I: 'a> Matcher<'a, I> for ContainsInOrder<T>
impl<'a, T, I: 'a> Matcher<'a, I> for ContainsSubset<T>
impl<'a, T, I> Matcher<'a, I> for ContainsInAnyOrder<T>
impl<'a, T: 'a, F> Matcher<'a, T> for F
A closure can be used as a Matcher.
The closure must be repeatably callable in case that the matcher is combined with another matcher.