pub struct Changeable<T> {
pub from: Tracked<T>,
pub to: Tracked<T>,
}Expand description
Represents a changeable value.
The from or to values are Tracked values, so the following cases
mean the value is unchanged:
- Both values are
Tracked::None - Both values are
Tracked::Known(t), and bothts are equal.
When either value is Tracked::Unknown, then its Equality is
[Unknown].
§Design Note
This is deliberately called Changeable instead of Change, because
Change implies there is a change, whereas Changeable means there may
be one.
Fields§
§from: Tracked<T>Current value.
to: Tracked<T>Next value.
Implementations§
Source§impl<T> Changeable<T>where
T: MaybeEq,
impl<T> Changeable<T>where
T: MaybeEq,
Sourcepub fn new(from: Tracked<T>, to: Tracked<T>) -> Self
pub fn new(from: Tracked<T>, to: Tracked<T>) -> Self
Returns a new Changeable value.
See Changeable::known if both values are known.
Sourcepub fn known(from: T, to: T) -> Self
pub fn known(from: T, to: T) -> Self
Returns a new Changeable value.
See Changeable::known if both values are known.
Trait Implementations§
Source§impl<T: Clone> Clone for Changeable<T>
impl<T: Clone> Clone for Changeable<T>
Source§fn clone(&self) -> Changeable<T>
fn clone(&self) -> Changeable<T>
Returns a duplicate 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 Changeable<T>
impl<T: Debug> Debug for Changeable<T>
Source§impl<'de, T> Deserialize<'de> for Changeable<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Changeable<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: PartialEq> PartialEq for Changeable<T>
impl<T: PartialEq> PartialEq for Changeable<T>
Source§impl<T> Serialize for Changeable<T>where
T: Serialize,
impl<T> Serialize for Changeable<T>where
T: Serialize,
impl<T: Eq> Eq for Changeable<T>
impl<T> StructuralPartialEq for Changeable<T>
Auto Trait Implementations§
impl<T> Freeze for Changeable<T>where
T: Freeze,
impl<T> RefUnwindSafe for Changeable<T>where
T: RefUnwindSafe,
impl<T> Send for Changeable<T>where
T: Send,
impl<T> Sync for Changeable<T>where
T: Sync,
impl<T> Unpin for Changeable<T>where
T: Unpin,
impl<T> UnwindSafe for Changeable<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