Trait Patch

Source
pub trait Patch<P> {
    // Required methods
    fn apply(&mut self, patch: P);
    fn into_patch_by_diff(self, previous_struct: Self) -> P;
    fn new_empty_patch() -> P;
}
Expand description

The trait can apply patch and generete corresponding patch instance

Required Methods§

Source

fn apply(&mut self, patch: P)

Apply the patch, only update the existing fields

Source

fn into_patch_by_diff(self, previous_struct: Self) -> P

Diff on a previous state and into the patch instance

Source

fn new_empty_patch() -> P

Get an empty patch instance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§