pub trait StructDiffer {
type Ok;
type Err;
// Required methods
fn diff_field<T>(&mut self, name: &'static str, a: &T, b: &T)
where T: Diff + ?Sized;
fn end(self) -> Result<Self::Ok, Self::Err>;
// Provided method
fn skip_field<T: ?Sized>(&mut self, _name: &'static str) { ... }
}Expand description
A type that can deal with differences in a struct.
Required Associated Types§
Required Methods§
Sourcefn diff_field<T>(&mut self, name: &'static str, a: &T, b: &T)
fn diff_field<T>(&mut self, name: &'static str, a: &T, b: &T)
Visits a field name with values a and b in the respective
structures.
Provided Methods§
Sourcefn skip_field<T: ?Sized>(&mut self, _name: &'static str)
fn skip_field<T: ?Sized>(&mut self, _name: &'static str)
Skips a field that is excluded from differencing.
Some differs may e.g. print a placeholder for skipped fields.
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.