enum Update<T> {
Unchanged,
Set(T),
}Variants§
Implementations§
Source§impl<T> Update<T>
impl<T> Update<T>
Sourcepub fn is_unchanged(&self) -> bool
pub fn is_unchanged(&self) -> bool
Returns true if this is a Update::Unchanged, otherwise false
Sourcepub fn as_set_mut(&mut self) -> Option<&mut T>
pub fn as_set_mut(&mut self) -> Option<&mut T>
Optionally returns mutable references to the inner fields if this is a Update::Set, otherwise None
Sourcepub fn as_set(&self) -> Option<&T>
pub fn as_set(&self) -> Option<&T>
Optionally returns references to the inner fields if this is a Update::Set, otherwise None
Sourcepub fn into_set(self) -> Result<T, Self>
pub fn into_set(self) -> Result<T, Self>
Returns the inner fields if this is a Update::Set, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_set_unchecked(self) -> T
pub unsafe fn into_set_unchecked(self) -> T
Unchecked return of the inner fields of Update::Set.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_set_unchecked(&self) -> &T
pub unsafe fn as_set_unchecked(&self) -> &T
Unchecked reference of the inner fields of Update::Set.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_set_mut_unchecked(&mut self) -> &mut T
pub unsafe fn as_set_mut_unchecked(&mut self) -> &mut T
Unchecked mutable reference of the inner fields of Update::Set.
§Safety
Results in undefined behavior when it is the incorrect variant.
Trait Implementations§
impl<T: Copy> Copy for Update<T>
Auto Trait Implementations§
impl<T> Freeze for Update<T>where
T: Freeze,
impl<T> RefUnwindSafe for Update<T>where
T: RefUnwindSafe,
impl<T> Send for Update<T>where
T: Send,
impl<T> Sync for Update<T>where
T: Sync,
impl<T> Unpin for Update<T>where
T: Unpin,
impl<T> UnsafeUnpin for Update<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Update<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more