[go: up one dir, main page]

Trait Matcher

Source
pub trait Matcher<A, E> {
    // Required methods
    fn failure_message(&self, join: Join, actual: &A) -> String;
    fn matches(&self, actual: &A) -> bool;
}
Expand description

A Matcher trait.

Required Methods§

Source

fn failure_message(&self, join: Join, actual: &A) -> String

Returns a failure message.

Source

fn matches(&self, actual: &A) -> bool

Checks if an actual value matches an expected value.

Implementors§

Source§

impl Matcher<bool, ()> for BeFalse

Source§

impl Matcher<bool, ()> for BeTrue

Source§

impl<A> Matcher<Option<A>, ()> for BeNone
where A: Debug,

Source§

impl<A> Matcher<Option<A>, ()> for BeSome
where A: Debug,

Source§

impl<A, E> Matcher<A, E> for BeEqualTo<E>
where A: PartialEq<E> + Debug, E: Debug,

Source§

impl<A, E> Matcher<A, E> for PartialOrder<E>
where A: PartialOrd<E> + Debug, E: Debug,

Source§

impl<A, R> Matcher<A, ()> for BeWithinRange<R, A>
where A: PartialOrd<A> + Debug, R: RangeBounds<A> + Debug,

Source§

impl<A, T> Matcher<Result<A, T>, ()> for BeOk
where A: Debug, T: Debug,

Source§

impl<A, T> Matcher<Result<T, A>, ()> for BeErr
where A: Debug, T: Debug,

Source§

impl<A, T> Matcher<A, ()> for BeEmpty
where A: Iterator<Item = T> + Clone,

Source§

impl<A, T> Matcher<A, ()> for HaveCount
where A: Iterator<Item = T> + Clone,

Source§

impl<E> Matcher<E, E> for BeCloseTo<E>
where E: Float + Debug,