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>
impl<'a, T, U> Apply for DeepDiff<'a, T, U>
type Parent = T
fn apply_to_base(&self, source: &mut Self::Parent, errs: &mut Vec<ApplyError>)
Source§impl<T, U> Replace for DeepDiff<'_, T, U>
impl<T, U> Replace for DeepDiff<'_, T, U>
fn is_unchanged(&self) -> bool
fn is_replaced(&self) -> bool
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>
impl<'a, Full, Patch> Sync for DeepDiff<'a, Full, Patch>
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> 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