#[repr(C)]pub enum InsertMode {
Overwrite = 0,
Add = 1,
Append = 2,
Prepend = 3,
}Expand description
Selects the behavior for an insert when the new key matches an existing key.
A KV store maintains the property that its keys are unique from each other. If an insert has a key that doesn’t match any key already in the store, then the pair of the key and the new value is inserted into the store. However, if the insert’s key does match a key already in the store, then no new key-value pair is inserted, and the insert’s mode determines what it does instead.
Variants§
Overwrite = 0
Updates the existing key’s value by overwriting it with the new value.
This is the default mode.
Add = 1
Fails, leaving the existing key’s value unmodified.
With this mode, the insert fails with a “precondition failed” error, and does not modify the existing value. Inserts with this mode will only “add” new key-value pairs; they are prevented from modifying any existing ones.
Append = 2
Updates the existing key’s value by appending the new value to it.
Prepend = 3
Updates the existing key’s value by prepending the new value to it.
Trait Implementations§
Source§impl Clone for InsertMode
impl Clone for InsertMode
Source§fn clone(&self) -> InsertMode
fn clone(&self) -> InsertMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for InsertMode
impl Default for InsertMode
Source§fn default() -> InsertMode
fn default() -> InsertMode
impl Copy for InsertMode
Auto Trait Implementations§
impl Freeze for InsertMode
impl RefUnwindSafe for InsertMode
impl Send for InsertMode
impl Sync for InsertMode
impl Unpin for InsertMode
impl UnwindSafe for InsertMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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