pub struct DBMap<K, V> {
    pub rocksdb: Arc<DBWithThreadMode<MultiThreaded>>,
    /* private fields */
}
Expand description

An interface to a rocksDB database, keyed by a columnfamily

Fields

rocksdb: Arc<DBWithThreadMode<MultiThreaded>>

Implementations

Opens a database from a path, with specific options and an optional column family.

This database is used to perform operations on single column family, and parametrizes all operations in DBBatch when writting across column families.

Reopens an open database as a typed map operating under a specific column family. if no column family is passed, the default column family is used.

   use typed_store::rocks::*;
   use tempfile::tempdir;
   /// Open the DB with all needed column families first.
   let rocks = open_cf(tempdir().unwrap(), None, &["First_CF", "Second_CF"]).unwrap();
   /// Attach the column families to specific maps.
   let db_cf_1 = DBMap::<u32,u32>::reopen(&rocks, Some("First_CF")).expect("Failed to open storage");
   let db_cf_2 = DBMap::<u32,u32>::reopen(&rocks, Some("Second_CF")).expect("Failed to open storage");

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns a vector of values corresponding to the keys provided.

Returns true if the map contains a value for the specified key.

Returns the value for the given key from the map, if it exists.

Inserts the given key-value pair into the map.

Removes the entry for the given key from the map.

Removes every key-value pair from the map.

Returns true if the map is empty, otherwise false.

Returns an iterator visiting each key-value pair in the map.

Returns an iterator over each key in the map.

Returns an iterator over each value in the map.

Inserts key-value pairs.

Removes keys.

Returns the value for the given key from the map, if it exists or the given default value if it does not. Read more

Error type.

Try to extend the collection from the given iterator.

Try to extend the collection from the given slice.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.