[−][src]Crate exonum_rocksdb
Rust wrapper for RocksDB
.
Examples
extern crate tempdir; extern crate exonum_rocksdb; use exonum_rocksdb::DB; use tempdir::TempDir; // NB: db is automatically closed at end of lifetime let temp_dir = TempDir::new("storage").unwrap(); let db = DB::open_default(temp_dir.path()).unwrap(); let _ = 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 compaction_filter::Decision as CompactionDecision; |
pub use merge_operator::MergeOperands; |
Modules
backup | |
compaction_filter | |
merge_operator | rustic merge operator |
utils |
Structs
BlockBasedOptions | For configuring block-based file storage. |
ColumnFamily | An opaque type used to represent a column family. Returned from some functions, and used in others |
DB | A |
DBIterator | An iterator over a database or column family, with specifiable ranges and direction. |
DBRawIterator | 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. |
ReadOptions | |
Snapshot | A consistent view of the database at the point of creation. |
WriteBatch | An atomic batch of write operations. |
WriteOptions | Optionally disable WAL or sync for this write. |
Enums
DBCompactionStyle | |
DBCompressionType | |
DBRecoveryMode | |
Direction | |
IteratorMode |
Functions
new_bloom_filter |