Struct rusty_leveldb::DB [] [src]

pub struct DB { /* fields omitted */ }

DB contains the actual database implemenation. As opposed to the original, this implementation is not concurrent (yet).

Methods

impl DB
[src]

[src]

Opens or creates a new or existing database. name is the name of the directory containing the database.

Whether a new database is created and what happens if a database exists at the given path depends on the options set (create_if_missing, error_if_exists).

impl DB
[src]

[src]

Adds a single entry. It's a short, non-synchronous, form of write(); in order to make sure that the written entry is on disk, call flush() afterwards.

[src]

Deletes a single entry. Like with put(), you can call flush() to guarantee that the operation made it to disk.

[src]

Writes an entire WriteBatch. sync determines whether the write should be flushed to disk.

[src]

flush makes sure that all pending changes (e.g. from put()) are stored on disk.

impl DB
[src]

[src]

get_at reads the value for a given key at or before snapshot. It returns Ok(None) if the entry wasn't found, and Err(_) if an error occurred.

[src]

get is a simplified version of get_at(), translating errors to None.

impl DB
[src]

[src]

new_iter returns a DBIterator over the current state of the database. The iterator will not return elements added to the database after its creation.

[src]

new_iter_at returns a DBIterator at the supplied snapshot.

impl DB
[src]

[src]

Returns a snapshot at the current state. It can be used to retrieve entries from the database as they were at an earlier point in time.

impl DB
[src]

[src]

compact_range triggers an immediate compaction on the specified key range. Repeatedly calling this without actually adding new keys is not useful.

Compactions in general will cause the database to find entries more quickly, and take up less space on disk.

Trait Implementations

impl Drop for DB
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl !Send for DB

impl !Sync for DB