of_persist
of_persist provides append-only JSONL persistence for normalized orderflow events, with optional retention pruning.
It is designed for replay, auditability, and post-trade research workflows.
Main Types
- [
RollingStore] - append-only store forbookandtradesstreams. - [
RetentionPolicy] - bounded retention by total bytes and/or max file age. - [
PersistError] / [PersistResult<T>] - persistence error contract.
Storage Layout
Events are written to:
<root>/<venue>/<symbol>/(book|trades).jsonl
This makes stream files easy to map into replay and analytics pipelines.
Quick Example
use ;
use RollingStore;
let store = new.expect;
store.append_trade.expect;
Retention Example
use ;
let store = new?
.with_retention;
let _ = store;
# Ok::
Retention Behavior
max_age_secs > 0: files older than threshold are pruned.max_total_bytes > 0: oldest files are pruned until under limit.0means that limit is disabled.