Struct kvdb_rocksdb::Database

source ·
pub struct Database { /* private fields */ }
Expand description

Key-Value database.

Implementations§

Open database file.

Safety

The number of config.columns must not be zero.

Helper to create new transaction for this database.

Commit transaction to database.

Get value by key.

Get value by partial key. Prefix size should match configured prefix size.

Iterator over the data in the given database column index. Will hold a lock until the iterator is dropped preventing the database from being closed.

The number of column families in the db.

The number of keys in a column (estimated).

Remove the last column family in the database. The deletion is definitive.

Add a new column family to the DB.

Get RocksDB statistics.

Try to catch up a secondary instance with the primary by reading as much from the logs as possible.

Guaranteed to have changes up to the the time that try_catch_up_with_primary is called if it finishes succesfully.

Blocks until the MANIFEST file and any state changes in the corresponding Write-Ahead-Logs are applied to the secondary instance. If the manifest files are very large this method could take a long time.

If Write-Ahead-Logs have been purged by the primary instance before the secondary is able to open them, the secondary will not be caught up until this function is called again and new Write-Ahead-Logs are identified.

If called while the primary is writing, the catch-up may fail.

If the secondary is unable to catch up because of missing logs, this method fails silently and no error is returned.

Calling this as primary will return an error.

Trait Implementations§

Get a value by key.
Get the first value matching the given prefix.
Write a transaction of changes to the backing store.
Iterate over the data for a given column.
Iterate over the data for a given column, returning all key/value pairs where the key starts with the given prefix. Read more
Query statistics. Read more
Helper to create a new transaction.
Check for the existence of a value by key.
Check for the existence of a value by prefix.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.