#[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 more