| Crates.io | ministate |
| lib.rs | ministate |
| version | 0.1.1 |
| created_at | 2025-11-05 10:38:23.42985+00 |
| updated_at | 2025-11-06 06:25:19.251528+00 |
| description | A minimal, embeddable state manager with durable WAL logging and optional snapshot support. Ideal for component registries, metadata stores, and local state machines in edge applications. |
| homepage | |
| repository | https://github.com/ArcellaTeam/mini-rs/ |
| max_upload_size | |
| id | 1917807 |
| size | 40,919 |
ministateMinimal state manager with durable WAL logging
Part of the mini-rs embeddable toolkit
ministategives you just enough: crash-safe, in-memory state with replayable history.
ministate provides a simple yet robust way to maintain mutable application state that survives process restarts, using an append-only Write-Ahead Log (WAL) built on ministore.
Key features:
RwLock, full Clone on demand.fsynced before being applied.snapshot feature for faster recovery (via minisnap).Perfect for:
[dependencies]
ministate = "0.1"
serde = { version = "1.0", features = ["derive"] }
use ministate::{Mutator, StateManager};
use serde::{Deserialize, Serialize};
#[derive(Default, Clone, Serialize, Deserialize)]
struct Counter { value: u32 }
#[derive(Serialize, Deserialize)]
struct Inc { by: u32 }
impl Mutator<Counter> for Inc {
fn apply(&self, state: &mut Counter) {
state.value += self.by;
}
}
let mgr = StateManager::open("./state", "counter.wal.jsonl").await?;
mgr.apply(Inc { by: 10 }).await?;
assert_eq!(mgr.snapshot().await.value, 10);
[dependencies]
ministate = { version = "0.1", features = ["snapshot"] }
minisnap = "0.1"
mgr.create_snapshot().await?; // saves state + sequence number
| Guarantee | Description |
|---|---|
| Durability | If apply().await returns Ok, the mutation is on disk. |
| Atomicity | In-memory state is updated only after WAL write succeeds. |
| Ordering | Mutations applied in exact WAL order. |
| Recoverability | Full state restored from WAL (or WAL + snapshot). |
mini-rsministore — durable WAL engineminisnap — optional snapshot & log compaction supportministate — state manager (this crate)miniqueue — durable message queue (in development)Used in:
Dual-licensed under:
Choose the one that best fits your project.
ministate— because state should be simple, durable, and recoverable.
Part of themini-rsfamily: simple, embeddable, reliable.