pub struct Description { /* private fields */ }Expand description
A composable description of a matcher’s expectation.
Implementations§
Source§impl Description
impl Description
Sourcepub fn text(text: impl Into<Cow<'static, str>>) -> Description
pub fn text(text: impl Into<Cow<'static, str>>) -> Description
A leaf description: a finished phrase like equal to 4.
Sourcepub fn and(self, other: Description) -> Description
pub fn and(self, other: Description) -> Description
Combines this description with other under conjunction. Nested
conjunctions are flattened, so a.and(b).and(c) is a single All.
Sourcepub fn or(self, other: Description) -> Description
pub fn or(self, other: Description) -> Description
Combines this description with other under disjunction. Nested
disjunctions are flattened, so a.or(b).or(c) is a single Any.
Sourcepub fn labeled(
header: impl Into<Cow<'static, str>>,
child: Description,
) -> Description
pub fn labeled( header: impl Into<Cow<'static, str>>, child: Description, ) -> Description
Places child indented beneath a header: line. Used by nested
matchers to keep their expected blocks readable.
Trait Implementations§
Source§impl Clone for Description
impl Clone for Description
Source§fn clone(&self) -> Description
fn clone(&self) -> Description
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Description
impl Debug for Description
Source§impl Display for Description
impl Display for Description
Source§impl Not for Description
impl Not for Description
Source§fn not(self) -> Description
fn not(self) -> Description
Negates this description. Double negation cancels, so !!x renders as
x.
Source§type Output = Description
type Output = Description
The resulting type after applying the
! operator.Source§impl PartialEq for Description
impl PartialEq for Description
Source§fn eq(&self, other: &Description) -> bool
fn eq(&self, other: &Description) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Description
impl StructuralPartialEq for Description
Auto Trait Implementations§
impl Freeze for Description
impl RefUnwindSafe for Description
impl Send for Description
impl Sync for Description
impl Unpin for Description
impl UnsafeUnpin for Description
impl UnwindSafe for Description
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more