Struct pretty_assertions::Comparison
source · [−]pub struct Comparison<'a, TLeft, TRight> where
TLeft: ?Sized,
TRight: ?Sized, { /* private fields */ }
Expand description
A comparison of two values.
Where both values implement Debug
, the comparison can be displayed as a pretty diff.
use pretty_assertions::Comparison;
print!("{}", Comparison::new(&123, &134));
The values may have different types, although in practice they are usually the same.
Implementations
sourceimpl<'a, TLeft, TRight> Comparison<'a, TLeft, TRight> where
TLeft: ?Sized,
TRight: ?Sized,
impl<'a, TLeft, TRight> Comparison<'a, TLeft, TRight> where
TLeft: ?Sized,
TRight: ?Sized,
sourcepub fn new(left: &'a TLeft, right: &'a TRight) -> Comparison<'a, TLeft, TRight>
pub fn new(left: &'a TLeft, right: &'a TRight) -> Comparison<'a, TLeft, TRight>
Store two values to be compared in future.
Expensive diffing is deferred until calling Debug::fmt
.
Trait Implementations
Auto Trait Implementations
impl<'a, TLeft: ?Sized, TRight: ?Sized> RefUnwindSafe for Comparison<'a, TLeft, TRight> where
TLeft: RefUnwindSafe,
TRight: RefUnwindSafe,
impl<'a, TLeft: ?Sized, TRight: ?Sized> Send for Comparison<'a, TLeft, TRight> where
TLeft: Sync,
TRight: Sync,
impl<'a, TLeft: ?Sized, TRight: ?Sized> Sync for Comparison<'a, TLeft, TRight> where
TLeft: Sync,
TRight: Sync,
impl<'a, TLeft: ?Sized, TRight: ?Sized> Unpin for Comparison<'a, TLeft, TRight>
impl<'a, TLeft: ?Sized, TRight: ?Sized> UnwindSafe for Comparison<'a, TLeft, TRight> where
TLeft: RefUnwindSafe,
TRight: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more