Expand description
Rust wrapper for RocksDB.
§Examples
use rocksdb::DB;
// NB: db is automatically closed at end of lifetime
let db = DB::open_default("path/for/rocksdb/storage").unwrap();
db.put(b"my key", b"my value");
match db.get(b"my key") {
Ok(Some(value)) => println!("retrieved value {}", value.to_utf8().unwrap()),
Ok(None) => println!("value not found"),
Err(e) => println!("operational problem encountered: {}", e),
}
db.delete(b"my key").unwrap();
Re-exports§
pub use merge_operator::MergeOperands;
pub use compaction_filter::Decision as CompactionDecision;
Modules§
- backup
- compaction_
filter - merge_
operator - rustic merge operator
Structs§
- Block
Based Options - For configuring block-based file storage.
- Column
Family - An opaque type used to represent a column family. Returned from some functions, and used in others
- DB
- A RocksDB database.
- DBIterator
- An iterator over a database or column family, with specifiable ranges and direction.
- DBRaw
Iterator - An iterator over a database or column family, with specifiable ranges and direction.
- DBVector
- Vector of bytes stored in the database.
- Error
- A simple wrapper round a string, used for errors reported from ffi calls.
- Options
- Database-wide options around performance and behavior.
- Read
Options - Rtree
Iterator Context - Snapshot
- A consistent view of the database at the point of creation.
- Write
Batch - An atomic batch of write operations.
- Write
Options - Optionally disable WAL or sync for this write.