9 releases
0.1.8 | Sep 24, 2024 |
---|---|
0.1.7 | Aug 16, 2024 |
0.1.5 | Jul 29, 2024 |
0.1.4 | Aug 28, 2023 |
0.1.1 | Jun 12, 2023 |
#591 in Database interfaces
321 downloads per month
Used in silver-platter
26KB
583 lines
Rust bindings for TDB
This rust crate provides idiomatic Rust bindings for the Trivial Database (TDB) library.
See the TDB homepage for more details.
Example
use trivialdb::{Tdb,Flags};
let mut tdb = Tdb::memory(None, Flags::empty()).unwrap();
tdb.store(b"key", b"value", None).unwrap();
assert_eq!(Some(b"value".to_vec()), tdb.fetch(b"key").unwrap());
lib.rs
:
Rust bindings for TDB (Trivial Database)
TDB is a simple database that provides a key-value store. It is designed to be fast and reliable, and is used by Samba for storing data. It supports multiple readers and writers at the same time.
This crate provides a safe, rustic wrapper around the TDB C API.
Example
use trivialdb::{Flags,Tdb};
let mut tdb = Tdb::memory(None, Flags::empty()).unwrap();
tdb.store(b"foo", b"bar", None).unwrap();
assert_eq!(tdb.fetch(b"foo").unwrap().unwrap(), b"bar");
Dependencies
~0–2.3MB
~46K SLoC