| Crates.io | heaplet |
| lib.rs | heaplet |
| version | 0.1.0 |
| created_at | 2026-01-02 12:26:34.36029+00 |
| updated_at | 2026-01-02 12:26:34.36029+00 |
| description | A small, in-process, Redis-inspired in-memory store for Rust. |
| homepage | https://github.com/mudern/heaplet |
| repository | https://github.com/mudern/heaplet |
| max_upload_size | |
| id | 2018466 |
| size | 154,444 |
heaplet is an in-process, in-memory data structure library for Rust.
It provides a single Store that maps keys to multiple native data structures
(strings, hashes, sets, lists, deques, and sorted sets) through a typed, SDK-style API.
There is no server, no protocol, no networking — everything runs inside your process.
heaplet is designed for situations where you want:
bincode)[dependencies]
heaplet = "0.1"
use heaplet::Store;
fn main() -> Result<(), heaplet::Error> {
let store = Store::new();
// String / KV
store.kv().set("count", &1_i64)?;
store.kv().incr("count")?;
let v: Option<i64> = store.kv().get("count")?;
assert_eq!(v, Some(2));
// Hash
let user = store.hash("user:1");
user.hset("name", &"alice")?;
let name: Option<String> = user.hget("name")?;
// List
let queue = store.list("queue");
queue.rpush(&42)?;
let x: Option<i32> = queue.lpop()?;
// Sorted set
let rank = store.zset("rank");
rank.zadd(100.0, &"tom")?;
let top: Vec<String> = rank.zrevrange(0, 0)?;
Ok(())
}
heaplet exposes structured views instead of flat commands.
Each key is bound to a data-structure-specific handle:
use heaplet::Store;
fn main() -> Result<(), heaplet::Error> {
let store = Store::new();
{
let h = store.hash("user:1");
h.hset("age", &18)?;
let age: Option<i32> = h.hget("age")?;
assert_eq!(age, Some(18));
}
Ok(())
}
This provides:
Full API details are available in the generated documentation.
heaplet is intentionally local and embedded.
MIT