pub enum Diff<T: Storable> {
Identical,
RecordMissing {
actual: T,
},
ActualMissing {
record: T,
},
Different {
record: T,
actual: T,
},
Skipped,
}Expand description
Shows which information is identical, missing or different in diff calculations.
We use this to compare anything that’s storable.
Variants§
Identical
Both record and actual values are identical.
RecordMissing
Fields
§
actual: TThe actual value found (probably) in workspace
We don’t have the record, but we have the actual value
ActualMissing
Fields
§
record: TThe record value found in the stores
We have the record, but we don’t have the actual value
Different
Both record and actual values are present, but they differ
Skipped
We skipped this comparison. It’s not an error, but it means we didn’t compare this field. It may be shortcutted, we don’t care or irrelevant.
Implementations§
source§impl<T: Storable> Diff<T>
impl<T: Storable> Diff<T>
sourcepub fn changed(&self) -> bool
pub fn changed(&self) -> bool
Return true if the diff is not Diff::Identical or Diff::Skipped.
This is used to find out if
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Diff<T>where
for<'lt> T: Serialize + Deserialize<'lt> + Storable,
impl<'de, T> Deserialize<'de> for Diff<T>where for<'lt> T: Serialize + Deserialize<'lt> + Storable,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Ord + Storable> Ord for Diff<T>
impl<T: Ord + Storable> Ord for Diff<T>
source§impl<T: PartialEq + Storable> PartialEq<Diff<T>> for Diff<T>
impl<T: PartialEq + Storable> PartialEq<Diff<T>> for Diff<T>
source§impl<T: PartialOrd + Storable> PartialOrd<Diff<T>> for Diff<T>
impl<T: PartialOrd + Storable> PartialOrd<Diff<T>> for Diff<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<T> Storable for Diff<T>where
T: Storable,
impl<T> Storable for Diff<T>where T: Storable,
source§fn type_description() -> String
fn type_description() -> String
A string representation for the type. Read more
impl<T: Eq + Storable> Eq for Diff<T>
impl<T: Storable> StructuralEq for Diff<T>
impl<T: Storable> StructuralPartialEq for Diff<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Diff<T>where T: RefUnwindSafe,
impl<T> Send for Diff<T>where T: Send,
impl<T> Sync for Diff<T>where T: Sync,
impl<T> Unpin for Diff<T>where T: Unpin,
impl<T> UnwindSafe for Diff<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.