Skip to main content

Patch

Trait Patch 

Source
pub trait Patch: Diff {
    // Required method
    fn patch(old: &Self, diff: &Self::Diff) -> Self;
}
Expand description

Apply a diff to transform a value.

Required Methods§

Source

fn patch(old: &Self, diff: &Self::Diff) -> Self

Apply the diff to old to produce new.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Patch for Unit

Source§

impl Patch for Void

Source§

impl<H: Patch, T: Patch> Patch for Product<H, T>

Source§

impl<L: Patch + Clone, R: Patch + Clone> Patch for Sum<L, R>

Source§

impl<T: Patch> Patch for Field<T>

Source§

impl<T: Patch> Patch for Variant<T>

Source§

impl<T> Patch for T
where T: LeafDiff + Clone + PartialEq,