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.

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
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted. Read more
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted. Read more
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. 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.

Method to launch a heapsize measurement with a fresh state. Read more
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
Attempts to convert self into T using TryInto<T>. 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.