pub trait Matcher<T>where
T: ?Sized,{
// Required methods
fn check(&self, actual: &T) -> MatchResult;
fn description(&self) -> Description;
}Expand description
A reusable expectation about a value of type T.
T is ?Sized so matchers can target unsized values directly (str,
[u8]) without forcing the caller to borrow through a reference type.
Required Methods§
Sourcefn check(&self, actual: &T) -> MatchResult
fn check(&self, actual: &T) -> MatchResult
Checks actual against this matcher’s expectation.
Sourcefn description(&self) -> Description
fn description(&self) -> Description
Describes what this matcher expects, for use in failure output and in combinator descriptions.