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

No duplicate checking will be performed. This is the same as just calling CdbCreator.add().

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 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.

Add the key to the database unconditionally, but also check if it already existed.

TODO: what return value does put give?

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for CdbPutMode
[src]

impl Debug for CdbPutMode
[src]

Formats the value using the given formatter.

impl PartialEq for CdbPutMode
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for CdbPutMode
[src]