Struct lmdb_rs::core::Database [] [src]

pub struct Database<'a> { /* fields omitted */ }

Database

Methods

impl<'a> Database<'a>
[src]

Retrieves current db's statistics.

Retrieves a value by key. In case of DbAllowDups it will be the first value

Sets value for key. In case of DbAllowDups it will add a new item

Appends new key-value pair to database, starting a new page instead of splitting an existing one if necessary. Requires that key be >= all existing keys in the database (or will return KeyExists error).

Appends new value for the given key (requires DbAllowDups), starting a new page instead of splitting an existing one if necessary. Requires that value be >= all existing values for the given key (or will return KeyExists error).

Set value for key. Fails if key already exists, even when duplicates are allowed.

Deletes value for key.

Should be used only with DbAllowDups. Deletes corresponding (key, value)

Returns a new cursor

Deletes current db, also moves it out

Removes all key/values from db

Returns an iterator for all values in database

Returns an iterator through keys starting with start_key (>=), start_key is included

Returns an iterator through keys less than end_key, end_key is not included

Returns an iterator through keys start_key <= x < end_key. This is, start_key is included in the iteration, while end_key is kept excluded.

Returns an iterator for values between start_key and end_key (included). Currently it works only for unique keys (i.e. it will skip multiple items when DB created with ffi::MDB_DUPSORT). Iterator is valid while cursor is valid

Returns an iterator for all items (i.e. values with same key)

Sets the key compare function for this database.

Warning: This function must be called before any data access functions are used, otherwise data corruption may occur. The same comparison function must be used by every program accessing the database, every time the database is used.

If not called, keys are compared lexically, with shorter keys collating before longer keys.

Setting lasts for the lifetime of the underlying db handle.

Sets the value comparison function for values of the same key in this database.

Warning: This function must be called before any data access functions are used, otherwise data corruption may occur. The same dupsort function must be used by every program accessing the database, every time the database is used.

If not called, values are compared lexically, with shorter values collating before longer values.

Only used when DbAllowDups is true. Setting lasts for the lifetime of the underlying db handle.

Trait Implementations

impl<'a> Debug for Database<'a>
[src]

Formats the value using the given formatter.