pub trait Diffable {
type Item: Storable;
// Provided methods
fn diff(
record: Option<&Self::Item>,
actual: Option<&Self::Item>,
) -> Diff<Self::Item> { ... }
fn diff_superficial(
record: &Self::Item,
actual: &Self::Item,
) -> Diff<Self::Item> { ... }
fn diff_thorough(
record: &Self::Item,
actual: &Self::Item,
) -> Diff<Self::Item> { ... }
}
Expand description
Used to find out if record and actual are different for type T
Required Associated Types§
Provided Methods§
Sourcefn diff(
record: Option<&Self::Item>,
actual: Option<&Self::Item>,
) -> Diff<Self::Item>
fn diff( record: Option<&Self::Item>, actual: Option<&Self::Item>, ) -> Diff<Self::Item>
⚠️ Usually you must update actual’s metadata and timestamp before calling this. Use diff_superficial and diff_thorough for shortcut comparisons. (e.g. when metadata is not changed, no need to compare the content. )
This is to convert optional entities to diffs. For example, a file may be missing from the disk, but it may exist in the records. ((Some(record), None) -> Diff::ActualMissing)
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.