Enum common_types::account_diff::Diff [−][src]
pub enum Diff<T> { Same, Born(T), Changed(T, T), Died(T), }
Diff type for specifying a change (or not).
Variants
Same
Both sides are the same.
Born(T)
Left (pre, source) side doesn't include value, right side (post, destination) does.
Changed(T, T)
Both sides include data; it chaged value between them.
Died(T)
Left (pre, source) side does include value, right side (post, destination) does not.
Methods
impl<T> Diff<T>
[src]
impl<T> Diff<T>
pub fn new(pre: T, post: T) -> Self where
T: Eq,
[src]
pub fn new(pre: T, post: T) -> Self where
T: Eq,
Construct new object with given pre
and post
.
pub fn pre(&self) -> Option<&T>
[src]
pub fn pre(&self) -> Option<&T>
Get the before value, if there is one.
pub fn post(&self) -> Option<&T>
[src]
pub fn post(&self) -> Option<&T>
Get the after value, if there is one.
pub fn is_same(&self) -> bool
[src]
pub fn is_same(&self) -> bool
Determine whether there was a change or not.
Trait Implementations
impl<T: Debug> Debug for Diff<T>
[src]
impl<T: Debug> Debug for Diff<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: PartialEq> PartialEq for Diff<T>
[src]
impl<T: PartialEq> PartialEq for Diff<T>
fn eq(&self, other: &Diff<T>) -> bool
[src]
fn eq(&self, other: &Diff<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Diff<T>) -> bool
[src]
fn ne(&self, other: &Diff<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Diff<T>
[src]
impl<T: Eq> Eq for Diff<T>
impl<T: Clone> Clone for Diff<T>
[src]
impl<T: Clone> Clone for Diff<T>