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.