pub struct Comparison<'a, TLeft, TRight>{ /* 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§
Source§impl<'a, TLeft, TRight> Comparison<'a, TLeft, TRight>
impl<'a, TLeft, TRight> Comparison<'a, TLeft, TRight>
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, TRight> Freeze for Comparison<'a, TLeft, TRight>
impl<'a, TLeft, TRight> RefUnwindSafe for Comparison<'a, TLeft, TRight>
impl<'a, TLeft, TRight> Send for Comparison<'a, TLeft, TRight>
impl<'a, TLeft, TRight> Sync for Comparison<'a, TLeft, TRight>
impl<'a, TLeft, TRight> Unpin for Comparison<'a, TLeft, TRight>
impl<'a, TLeft, TRight> UnwindSafe for Comparison<'a, TLeft, TRight>
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