pub trait Diff: Sized {
// Required method
fn record_diff<'a>(
&'a self,
old: &'a Self,
id_path: &IdPath,
difference: &mut Difference<&'a Self>,
);
// Provided method
fn diff<'a>(&'a self, old: &'a Self) -> Difference<&'a Self> { ... }
}
Expand description
A type that can be diffed in terms of id paths.
Required Methods§
Sourcefn record_diff<'a>(
&'a self,
old: &'a Self,
id_path: &IdPath,
difference: &mut Difference<&'a Self>,
)
fn record_diff<'a>( &'a self, old: &'a Self, id_path: &IdPath, difference: &mut Difference<&'a Self>, )
Appends the difference to “construct” this type from the given other one to the given difference.
Provided Methods§
Sourcefn diff<'a>(&'a self, old: &'a Self) -> Difference<&'a Self>
fn diff<'a>(&'a self, old: &'a Self) -> Difference<&'a Self>
Computes the difference to “construct” this type from the given other one.
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.