Skip to main content

MatcherTuple

Trait MatcherTuple 

Source
pub trait MatcherTuple<T>
where T: ?Sized,
{ // Required methods fn check_all(&self, actual: &T) -> MatchResult; fn check_any(&self, actual: &T) -> MatchResult; fn describe_all(&self) -> Description; fn describe_any(&self) -> Description; }
Expand description

A tuple of matchers, all targeting the same type T.

Implemented for tuples of arity 2 through 8 by a macro in this module; you do not implement it yourself. It is the input to all_of and any_of, which interpret the tuple under conjunction and disjunction respectively.

Required Methods§

Source

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

Every matcher in the tuple must match. Returns the first sub-matcher’s failure, so the error pinpoints which expectation broke.

Source

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

At least one matcher in the tuple must match. When none do, the failure describes the whole disjunction.

Source

fn describe_all(&self) -> Description

The conjunction (a and b and ...) of the tuple’s descriptions.

Source

fn describe_any(&self) -> Description

The disjunction (a or b or ...) of the tuple’s descriptions.

Implementations on Foreign Types§

Source§

impl<T, M1, M2> MatcherTuple<T> for (M1, M2)
where M1: Matcher<T>, M2: Matcher<T>, T: ?Sized,

Source§

impl<T, M1, M2, M3> MatcherTuple<T> for (M1, M2, M3)
where M1: Matcher<T>, M2: Matcher<T>, M3: Matcher<T>, T: ?Sized,

Source§

impl<T, M1, M2, M3, M4> MatcherTuple<T> for (M1, M2, M3, M4)
where M1: Matcher<T>, M2: Matcher<T>, M3: Matcher<T>, M4: Matcher<T>, T: ?Sized,

Source§

impl<T, M1, M2, M3, M4, M5> MatcherTuple<T> for (M1, M2, M3, M4, M5)
where M1: Matcher<T>, M2: Matcher<T>, M3: Matcher<T>, M4: Matcher<T>, M5: Matcher<T>, T: ?Sized,

Source§

impl<T, M1, M2, M3, M4, M5, M6> MatcherTuple<T> for (M1, M2, M3, M4, M5, M6)
where M1: Matcher<T>, M2: Matcher<T>, M3: Matcher<T>, M4: Matcher<T>, M5: Matcher<T>, M6: Matcher<T>, T: ?Sized,

Source§

impl<T, M1, M2, M3, M4, M5, M6, M7> MatcherTuple<T> for (M1, M2, M3, M4, M5, M6, M7)
where M1: Matcher<T>, M2: Matcher<T>, M3: Matcher<T>, M4: Matcher<T>, M5: Matcher<T>, M6: Matcher<T>, M7: Matcher<T>, T: ?Sized,

Source§

impl<T, M1, M2, M3, M4, M5, M6, M7, M8> MatcherTuple<T> for (M1, M2, M3, M4, M5, M6, M7, M8)
where M1: Matcher<T>, M2: Matcher<T>, M3: Matcher<T>, M4: Matcher<T>, M5: Matcher<T>, M6: Matcher<T>, M7: Matcher<T>, M8: Matcher<T>, T: ?Sized,

Implementors§