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
We don’t have the record, but we have the actual value
Fields
§
actual: T
The actual value found (probably) in workspace
ActualMissing
We have the record, but we don’t have the actual value
Fields
§
record: T
The record value found in the stores
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 shortcut, 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 T is changed.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Diff<T>
impl<'de, T> Deserialize<'de> for Diff<T>
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: PartialOrd + Storable> PartialOrd for Diff<T>
impl<T: PartialOrd + Storable> PartialOrd for Diff<T>
Source§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> StructuralPartialEq for Diff<T>
Auto Trait Implementations§
impl<T> Freeze for Diff<T>where
T: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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 Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more