Skip to main content

DisplayMatcher

Struct DisplayMatcher 

Source
pub struct DisplayMatcher<InnerMatcher> { /* private fields */ }
Expand description

A matcher which renders the actual value as a String with Display and matches the result against the given inner matcher.

Implementations§

Source§

impl<InnerMatcher> DisplayMatcher<InnerMatcher>

Source

pub fn alternate(self) -> Self

Indicates that the match should be made against the alternate rendering of the actual value. That is the result of formatting it with {:#}.

Trait Implementations§

Source§

impl<InnerMatcher: Describable> Describable for DisplayMatcher<InnerMatcher>

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§

impl<T: Debug + Display + ?Sized, InnerMatcher: Matcher<String>> Matcher<T> for DisplayMatcher<InnerMatcher>

Source§

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

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

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

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

Auto Trait Implementations§

§

impl<InnerMatcher> Freeze for DisplayMatcher<InnerMatcher>
where InnerMatcher: Freeze,

§

impl<InnerMatcher> RefUnwindSafe for DisplayMatcher<InnerMatcher>
where InnerMatcher: RefUnwindSafe,

§

impl<InnerMatcher> Send for DisplayMatcher<InnerMatcher>
where InnerMatcher: Send,

§

impl<InnerMatcher> Sync for DisplayMatcher<InnerMatcher>
where InnerMatcher: Sync,

§

impl<InnerMatcher> Unpin for DisplayMatcher<InnerMatcher>
where InnerMatcher: Unpin,

§

impl<InnerMatcher> UnsafeUnpin for DisplayMatcher<InnerMatcher>
where InnerMatcher: UnsafeUnpin,

§

impl<InnerMatcher> UnwindSafe for DisplayMatcher<InnerMatcher>
where InnerMatcher: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<M> MatcherExt for M

Source§

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

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

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

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V