pub enum StateChange<T> {
Changed(T),
Already(T),
}Expand description
Outcome of an idempotent mutating call: did the resource change, or was it already in the requested state? The wrapped object is the current state of the resource either way, so callers can render it consistently.
Variants§
Implementations§
Source§impl<T> StateChange<T>
impl<T> StateChange<T>
pub fn into_inner(self) -> T
pub fn was_changed(&self) -> bool
Trait Implementations§
Source§impl<T: Clone> Clone for StateChange<T>
impl<T: Clone> Clone for StateChange<T>
Source§fn clone(&self) -> StateChange<T>
fn clone(&self) -> StateChange<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for StateChange<T>where
T: Freeze,
impl<T> RefUnwindSafe for StateChange<T>where
T: RefUnwindSafe,
impl<T> Send for StateChange<T>where
T: Send,
impl<T> Sync for StateChange<T>where
T: Sync,
impl<T> Unpin for StateChange<T>where
T: Unpin,
impl<T> UnsafeUnpin for StateChange<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for StateChange<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