pub enum OptionDiff<T: Diffable> {
Removed(T),
Added(T),
Changed(<T as Diffable>::Repr),
Unchanged,
}Expand description
Enum representing the difference between two Option values.
Variants§
Removed(T)
Indicates that a value was removed (i.e., Some became None).
Added(T)
Indicates that a value was added (i.e., None became Some).
Changed(<T as Diffable>::Repr)
Indicates that the inner value of Some has changed.
Unchanged
Indicates that the value has not changed.
Trait Implementations§
Source§impl<T: Diffable> Changeable for OptionDiff<T>
impl<T: Diffable> Changeable for OptionDiff<T>
Source§fn is_changed(&self) -> bool
fn is_changed(&self) -> bool
Checks if the object has changed.
Source§fn is_unchanged(obj: &Self) -> bool
fn is_unchanged(obj: &Self) -> bool
Static method to check if an object has not changed.
Source§impl<T: Diffable> Default for OptionDiff<T>
impl<T: Diffable> Default for OptionDiff<T>
Source§fn default() -> OptionDiff<T>
fn default() -> OptionDiff<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for OptionDiff<T>where
T: Deserialize<'de> + Diffable,
impl<'de, T> Deserialize<'de> for OptionDiff<T>where
T: Deserialize<'de> + Diffable,
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> PartialEq for OptionDiff<T>
impl<T> PartialEq for OptionDiff<T>
Auto Trait Implementations§
impl<T> Freeze for OptionDiff<T>
impl<T> RefUnwindSafe for OptionDiff<T>
impl<T> Send for OptionDiff<T>
impl<T> Sync for OptionDiff<T>
impl<T> Unpin for OptionDiff<T>
impl<T> UnwindSafe for OptionDiff<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more