Trait struct_patch::traits::Patch
source · pub trait Patch<P>where
P: Default,{
fn apply(&mut self, patch: P);
fn into_patch_by_diff(self, previous_struct: Self) -> P;
fn default_patch() -> P { ... }
}Expand description
The trait can apply patch and generete corresponding patch instance
Required Methods§
sourcefn into_patch_by_diff(self, previous_struct: Self) -> P
fn into_patch_by_diff(self, previous_struct: Self) -> P
Diff on a previous state and into the patch instance
Provided Methods§
sourcefn default_patch() -> P
fn default_patch() -> P
Get an empty patch instance