DeepDiff

Enum DeepDiff 

Source
pub enum DeepDiff<'a, Full, Patch> {
    Unchanged,
    Patched(Patch),
    Replaced(&'a Full),
}
Expand description

A generic type which can represent three possible ‘diff’ states. Appropriate for primitive types which can be ‘partially’ changed (e.g. structs) c.f. AtomicDiff which cannot represent a Patched state

Variants§

§

Unchanged

The diffed value is unchanged

§

Patched(Patch)

The diffed value is partially changed - we will need to descend into the Patched value to find out exactly how

§

Replaced(&'a Full)

The diffed value is replaced in full

Trait Implementations§

Source§

impl<'a, T, U> Apply for DeepDiff<'a, T, U>
where T: Diffable<'a> + Clone, U: Apply<Parent = T>,

Source§

type Parent = T

Source§

fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)

Source§

impl<'a, Full: Clone, Patch: Clone> Clone for DeepDiff<'a, Full, Patch>

Source§

fn clone(&self) -> DeepDiff<'a, Full, Patch>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, Full: Debug, Patch: Debug> Debug for DeepDiff<'a, Full, Patch>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, Full: PartialEq, Patch: PartialEq> PartialEq for DeepDiff<'a, Full, Patch>

Source§

fn eq(&self, other: &DeepDiff<'a, Full, Patch>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, U> Replace for DeepDiff<'_, T, U>

Source§

impl<'a, Full, Patch> StructuralPartialEq for DeepDiff<'a, Full, Patch>

Auto Trait Implementations§

§

impl<'a, Full, Patch> Freeze for DeepDiff<'a, Full, Patch>
where Patch: Freeze,

§

impl<'a, Full, Patch> RefUnwindSafe for DeepDiff<'a, Full, Patch>
where Patch: RefUnwindSafe, Full: RefUnwindSafe,

§

impl<'a, Full, Patch> Send for DeepDiff<'a, Full, Patch>
where Patch: Send, Full: Sync,

§

impl<'a, Full, Patch> Sync for DeepDiff<'a, Full, Patch>
where Patch: Sync, Full: Sync,

§

impl<'a, Full, Patch> Unpin for DeepDiff<'a, Full, Patch>
where Patch: Unpin,

§

impl<'a, Full, Patch> UnwindSafe for DeepDiff<'a, Full, Patch>
where Patch: UnwindSafe, Full: RefUnwindSafe,

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.