batpak
Sync-first event sourcing for Rust: append-only log, causal metadata, policy gates, projections, subscriptions, and typestate-friendly workflows without an async runtime.
Start In 5 Minutes
If you just want the crate:
use *;
let config = new
.with_sync_every_n_events
.with_sync_mode;
let store = open?;
let coord = new?;
let kind = custom;
let receipt = store.append?;
println!;
store.close?;
# Ok::
Pick Your Lane
- User lane:
cargo build,cargo test,cargo run --example quickstart - Maintainer lane:
cargo xtask doctor,cargo xtask ci,cargo xtask preflight(gold standard before pushing) - Perf lane:
cargo xtask bench --surface neutral|native [--save|--compare]
What You Get
- Append-only segment store with CRC32 integrity
- Optional Blake3 hash chains
- Causal metadata and region queries
- Atomic batch append: multi-event commit with two-phase markers, crash recovery, and intra-batch causation
- Fault injection framework (
dangerous-test-hooksfeature) for chaos testing batch and write paths - Gate / receipt workflow for policy enforcement
- Event-sourced projections with optional native file-backed cache
subscribe_lossy/cursor_guaranteeddelivery names that say what they doclose(self) -> Closedfor explicit durable shutdown;Dropis best-effort only- Query/read operations yield
StoredEvent<serde_json::Value>at the storage boundary
Docs
Features
blake3(default): hash-chain verificationdangerous-test-hooks: explicit test-only runtime hooks
Canonical Commands
just remains available as shorthand, but cargo xtask is the canonical command surface.
License
MIT OR Apache-2.0