Skip to main content

Matcher

Trait Matcher 

Source
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§

Source

fn check(&self, actual: &T) -> MatchResult

Checks actual against this matcher’s expectation.

Source

fn description(&self) -> Description

Describes what this matcher expects, for use in failure output and in combinator descriptions.

Implementors§