Enum tinycdb_sys::CdbPutMode
[−]
[src]
#[repr(C)]pub enum CdbPutMode { Add, Replace, Insert, Warn, Replace0, }
CdbPutMode
represents the different behaviours that will be used when
inserting a key into a database where the key already exists.
Variants
Add
No duplicate checking will be performed. This is the same as just
calling CdbCreator.add()
.
Replace
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
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
Add the key to the database unconditionally, but also check if it already existed.
TODO: what return value does put give?
Replace0
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
impl Clone for CdbPutMode
[src]
fn clone(&self) -> CdbPutMode
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for CdbPutMode
[src]
impl Debug for CdbPutMode
[src]
impl PartialEq for CdbPutMode
[src]
fn eq(&self, __arg_0: &CdbPutMode) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.