Expand description
§lkv
A lightweight and fast embedded key-value store for Rust.
For more details, see the crates.io.
§Examples
use lkv::{Database, Result};
fn main() -> Result<()> {
let mut db = Database::create("./example.lkv")?;
let mut write = db.begin_write()?;
write.put("name", "lkv")?;
write.commit()?;
let read = db.begin_read()?;
assert_eq!(read.get("name")?, Some(b"lkv".as_slice()));
for item in read.iter()? {
let (key, value) = item?;
println!("{} = {}",
String::from_utf8_lossy(key),
String::from_utf8_lossy(value));
}
drop(read);
Ok(())
}Structs§
- Corruption
- Location and category of a database integrity failure.
- Database
- Represents an open lkv database.
- Database
Options - Provides configuration options for the database.
- Database
Stats - Constant-time structural and maintenance metrics for a database.
- Entries
- Fallible zero-copy iterator over a consistent database view.
- Read
Transaction - Read-only transaction of the database.
- Reserved
Value - A sequential writer for an exactly-sized value reservation.
- Snapshot
- Read-only snapshot of the database.
- Write
Transaction - Write transaction for the database.
Enums§
- Corruption
Kind - The class of integrity failure that was detected.
- Error
- Errors returned by
lkvAPI. - Verification
Mode - Integrity work performed while opening a database.
Type Aliases§
- Result
- Result type for
lkvAPIs.