pub enum StoreMode {
Always,
Absent,
Cas(String),
}Expand description
Defines the behavior for store operations.
This enum specifies how a store operation should behave when a key already exists in the storage system.
Variants§
Always
Indicates that the store operation should always succeed, overwriting any existing value.
This mode is useful when you want to unconditionally update a value regardless of its current state.
Absent
Indicates that the store operation should succeed only if no value was previously stored.
This mode is useful for implementing “set if not exists” semantics, ensuring that values are only written once.
Cas(String)
Indicates that the store operation should succeed only if the stored value matches the provided CAS.
This mode is useful for implementing optimistic concurrency control, ensuring that updates only succeed if the value hasn’t been modified by another operation.
Trait Implementations§
impl Eq for StoreMode
impl StructuralPartialEq for StoreMode
Auto Trait Implementations§
impl Freeze for StoreMode
impl RefUnwindSafe for StoreMode
impl Send for StoreMode
impl Sync for StoreMode
impl Unpin for StoreMode
impl UnsafeUnpin for StoreMode
impl UnwindSafe for StoreMode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<C, T> Extract<T> for Cwhere
T: FromContext<C>,
impl<C, T> Extract<T> for Cwhere
T: FromContext<C>,
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> ⓘ
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> ⓘ
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