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

#1794 in Database interfaces

Download history 272/week @ 2024-08-16 29/week @ 2024-08-23 44/week @ 2024-08-30 16/week @ 2024-09-06 26/week @ 2024-09-13 169/week @ 2024-09-20 101/week @ 2024-09-27 23/week @ 2024-10-04 7/week @ 2024-10-11 18/week @ 2024-10-18 16/week @ 2024-10-25 11/week @ 2024-11-01 51/week @ 2024-11-08 54/week @ 2024-11-15 17/week @ 2024-11-22 7/week @ 2024-11-29

130 downloads per month
Used in silver-platter

LGPL-3.0-or-later

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.4MB
~47K SLoC