pub struct Pair<T> {
pub old: T,
pub current: T,
}
Expand description
A pair consisting of an old and a current value that can be used for tracking changes between them.
Fields§
§old: T
The old value.
current: T
The current value.
Implementations§
Source§impl<T: Eq> Pair<T>
impl<T: Eq> Pair<T>
Sourcepub fn changed_to(&self, value: &T) -> bool
pub fn changed_to(&self, value: &T) -> bool
Checks if the value changed to a specific value that it was not before.
Sourcepub fn changed_from(&self, value: &T) -> bool
pub fn changed_from(&self, value: &T) -> bool
Checks if the value changed from a specific value that it is not now.
Sourcepub fn changed_from_to(&self, old: &T, current: &T) -> bool
pub fn changed_from_to(&self, old: &T, current: &T) -> bool
Checks if the value changed from a specific value to another specific value.
Source§impl<T: NoUninit> Pair<T>
impl<T: NoUninit> Pair<T>
Sourcepub fn bytes_changed(&self) -> bool
pub fn bytes_changed(&self) -> bool
Checks if the bytes of the value changed.
Sourcepub fn bytes_unchanged(&self) -> bool
pub fn bytes_unchanged(&self) -> bool
Checks if the bytes of the value did not change.
Sourcepub fn bytes_changed_to(&self, value: &T) -> bool
pub fn bytes_changed_to(&self, value: &T) -> bool
Checks if the bytes of the value changed to a specific value that it was not before.
Sourcepub fn bytes_changed_from(&self, value: &T) -> bool
pub fn bytes_changed_from(&self, value: &T) -> bool
Checks if the bytes of the value changed from a specific value that it is not now.
Sourcepub fn bytes_changed_from_to(&self, old: &T, current: &T) -> bool
pub fn bytes_changed_from_to(&self, old: &T, current: &T) -> bool
Checks if the bytes of the value changed from a specific value to another specific value.
Trait Implementations§
Source§impl<T: Clone + Widget> Widget for Pair<T>
impl<T: Clone + Widget> Widget for Pair<T>
impl<T: Copy> Copy for Pair<T>
Auto Trait Implementations§
impl<T> Freeze for Pair<T>where
T: Freeze,
impl<T> RefUnwindSafe for Pair<T>where
T: RefUnwindSafe,
impl<T> Send for Pair<T>where
T: Send,
impl<T> Sync for Pair<T>where
T: Sync,
impl<T> Unpin for Pair<T>where
T: Unpin,
impl<T> UnwindSafe for Pair<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