[][src]Enum tinycdb_sys::CdbPutMode

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

impl Copy for CdbPutMode[src]

impl Debug for CdbPutMode[src]

impl Eq for CdbPutMode[src]

impl PartialEq<CdbPutMode> for CdbPutMode[src]

impl StructuralEq for CdbPutMode[src]

impl StructuralPartialEq for CdbPutMode[src]

Auto Trait Implementations

impl RefUnwindSafe for CdbPutMode

impl Send for CdbPutMode

impl Sync for CdbPutMode

impl Unpin for CdbPutMode

impl UnwindSafe for CdbPutMode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.