Struct EqMatcher

Source
pub struct EqMatcher<T> { /* private fields */ }
Expand description

A matcher which matches a value equal to expected.

See eq.

Trait Implementations§

Source§

impl<T: Deref<Target = str>> From<EqMatcher<T>> for StrMatcher<T>

Source§

fn from(value: EqMatcher<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Debug, A: Debug + Copy + PartialEq<T>> Matcher<A> for EqMatcher<T>

Source§

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

Returns whether the condition matches the datum actual. Read more
Source§

fn describe(&self, matcher_result: MatcherResult) -> Description

Returns a description of self or a negative description if matcher_result is DoesNotMatch. Read more
Source§

fn explain_match(&self, actual: A) -> Description

Prepares a String describing how the expected value encoded in this instance matches or does not match the given value actual. Read more
Source§

impl<T> MatcherBase for EqMatcher<T>

Source§

fn and<Right>(self, right: Right) -> ConjunctionMatcher<Self, Right>
where Self: Sized,

Constructs a matcher that matches both self and right. Read more
Source§

fn or<Right>(self, right: Right) -> DisjunctionMatcher<Self, Right>
where Self: Sized,

Constructs a matcher that matches when at least one of self or right matches the input. Read more

Auto Trait Implementations§

§

impl<T> Freeze for EqMatcher<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for EqMatcher<T>
where T: RefUnwindSafe,

§

impl<T> Send for EqMatcher<T>
where T: Send,

§

impl<T> Sync for EqMatcher<T>
where T: Sync,

§

impl<T> Unpin for EqMatcher<T>
where T: Unpin,

§

impl<T> UnwindSafe for EqMatcher<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<ExpectedT, MatcherT> StrMatcherConfigurator<ExpectedT> for MatcherT
where MatcherT: Into<StrMatcher<ExpectedT>>,

Source§

fn ignoring_leading_whitespace(self) -> StrMatcher<ExpectedT>

Configures the matcher to ignore any leading whitespace in either the actual or the expected value. Read more
Source§

fn ignoring_trailing_whitespace(self) -> StrMatcher<ExpectedT>

Configures the matcher to ignore any trailing whitespace in either the actual or the expected value. Read more
Source§

fn ignoring_outer_whitespace(self) -> StrMatcher<ExpectedT>

Configures the matcher to ignore both leading and trailing whitespace in either the actual or the expected value. Read more
Source§

fn ignoring_ascii_case(self) -> StrMatcher<ExpectedT>

Configures the matcher to ignore ASCII case when comparing values. Read more
Source§

fn ignoring_unicode_case(self) -> StrMatcher<ExpectedT>

Configures the matcher to ignore Unicode case when comparing values. Read more
Source§

fn times(self, times: impl Matcher<usize> + 'static) -> StrMatcher<ExpectedT>

Configures the matcher to match only strings which otherwise satisfy the conditions a number times matched by the matcher times. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.