#[repr(C)]pub enum CdbPutMode {
Add = 0,
Replace = 1,
Insert = 2,
Warn = 3,
Replace0 = 4,
}
Expand description
CdbPutMode
represents the different behaviours that will be used when
inserting a key into a database where the key already exists.
Variants§
Add = 0
No duplicate checking will be performed. This is the same as just
calling CdbCreator.add()
.
Replace = 1
If the key already exists in the database, it will be removed prior to adding the new value. This can be quite slow if the file is large, due to having to copy data around.
Insert = 2
Insert the key into the database only if the key does not already exist. Note that since a simple query of the database only returns the first key, this is really only useful to save space in the database.
Warn = 3
Add the key to the database unconditionally, but also check if it already existed.
TODO: what return value does put give?
Replace0 = 4
If the key already exists in the database, zero it out before adding
this key/value pair. See the comments on CdbCreator.remove()
for some
caveats regarding zeroing out keys in the database.
Trait Implementations§
Source§impl Clone for CdbPutMode
impl Clone for CdbPutMode
Source§fn clone(&self) -> CdbPutMode
fn clone(&self) -> CdbPutMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more