pub enum DiffResult<T> {
None,
Same(T),
Added(T),
Updated(T, Option<Box<T>>),
Removed(T),
}
Variants§
Implementations§
Source§impl<T> DiffResult<T>
impl<T> DiffResult<T>
pub fn is_none(&self) -> bool
pub fn is_same(&self) -> bool
pub fn is_added(&self) -> bool
pub fn is_updated(&self) -> bool
pub fn is_upserted(&self) -> bool
pub fn is_removed(&self) -> bool
pub fn is_same_or_none(&self) -> bool
pub fn exists(&self) -> bool
pub fn new<C: DiffContext>(value: DiffResult<T>, context: &C) -> Self
pub fn get(&self) -> Option<&T>
pub fn take(self) -> Option<T>
pub fn as_ref(&self) -> DiffResult<&T>
Trait Implementations§
Source§impl<T: Clone> Clone for DiffResult<T>
impl<T: Clone> Clone for DiffResult<T>
Source§fn clone(&self) -> DiffResult<T>
fn clone(&self) -> DiffResult<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for DiffResult<T>
impl<T: Debug> Debug for DiffResult<T>
Source§impl<'de, T> Deserialize<'de> for DiffResult<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for DiffResult<T>where
T: Deserialize<'de>,
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> DiffOwnChanges for DiffResult<T>where
T: DiffOwnChanges,
impl<T> DiffOwnChanges for DiffResult<T>where
T: DiffOwnChanges,
fn get_own_changes(&self) -> Vec<(Cow<'_, str>, DiffResultType)>
Source§impl<T> From<&DiffResult<T>> for DiffResultType
impl<T> From<&DiffResult<T>> for DiffResultType
Source§fn from(diff: &DiffResult<T>) -> Self
fn from(diff: &DiffResult<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<DiffResult<&T>> for DiffResultType
impl<T> From<DiffResult<&T>> for DiffResultType
Source§fn from(diff: DiffResult<&T>) -> Self
fn from(diff: DiffResult<&T>) -> Self
Converts to this type from the input type.
Source§impl<T: PartialEq> PartialEq for DiffResult<T>
impl<T: PartialEq> PartialEq for DiffResult<T>
Source§impl<T> Serialize for DiffResult<T>where
T: Serialize,
impl<T> Serialize for DiffResult<T>where
T: Serialize,
impl<T> StructuralPartialEq for DiffResult<T>
Auto Trait Implementations§
impl<T> Freeze for DiffResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for DiffResult<T>where
T: RefUnwindSafe,
impl<T> Send for DiffResult<T>where
T: Send,
impl<T> Sync for DiffResult<T>where
T: Sync,
impl<T> Unpin for DiffResult<T>where
T: Unpin,
impl<T> UnwindSafe for DiffResult<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