Struct pretty_assertions::Comparison[][src]

pub struct Comparison<'a, TLeft, TRight> where
    TLeft: ?Sized,
    TRight: ?Sized
{ /* fields omitted */ }

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

impl<'a, TLeft, TRight> Comparison<'a, TLeft, TRight> where
    TLeft: ?Sized,
    TRight: ?Sized
[src]

pub fn new(left: &'a TLeft, right: &'a TRight) -> Comparison<'a, TLeft, TRight>[src]

Store two values to be compared in future.

Expensive diffing is deferred until calling Debug::fmt.

Trait Implementations

impl<'a, TLeft: ?Sized, TRight: ?Sized> Display for Comparison<'a, TLeft, TRight> where
    TLeft: Debug,
    TRight: Debug
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.