Struct tetsy_kvdb_rocksdb::Database[][src]

pub struct Database { /* fields omitted */ }
Expand description

Key-Value database.

Implementations

Open database file. Creates if it does not exist.

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.

Restore the database from a copy at given path.

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

Attempt to replace this database with a new one located at the given path.

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.

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. If T::size_of is a constant, consider implementing constant_size as well. Read more

Used to optimize MallocSizeOf implementation for collections like Vec and HashMap to avoid iterating over them unnecessarily. The Self: Sized bound is for object safety. Read more

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

Performs the conversion.

Performs the conversion.

Method to launch a heapsize measurement with a fresh state. Read more

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.