pub struct PersistenceConfig {Show 33 fields
pub enabled: bool,
pub retention_days: Option<u32>,
pub trades: Option<PersistDepth>,
pub agg_trades: Option<PersistDepth>,
pub klines: Option<PersistDepth>,
pub tickers: Option<PersistDepth>,
pub orderbook_snapshots: Option<PersistDepth>,
pub orderbook_deltas: Option<PersistDepth>,
pub mark_price: Option<PersistDepth>,
pub funding_rate: Option<PersistDepth>,
pub open_interest: Option<PersistDepth>,
pub liquidations: Option<PersistDepth>,
pub index_price: Option<PersistDepth>,
pub block_trade: Option<PersistDepth>,
pub auction_event: Option<PersistDepth>,
pub composite_index: Option<PersistDepth>,
pub volatility_index: Option<PersistDepth>,
pub historical_volatility: Option<PersistDepth>,
pub long_short_ratio: Option<PersistDepth>,
pub taker_volume: Option<PersistDepth>,
pub liquidation_bucket: Option<PersistDepth>,
pub basis: Option<PersistDepth>,
pub insurance_fund: Option<PersistDepth>,
pub settlement_event: Option<PersistDepth>,
pub predicted_funding: Option<PersistDepth>,
pub funding_settlement: Option<PersistDepth>,
pub risk_limit: Option<PersistDepth>,
pub option_greeks: Option<PersistDepth>,
pub mark_price_kline: Option<PersistDepth>,
pub index_price_kline: Option<PersistDepth>,
pub premium_index_kline: Option<PersistDepth>,
pub market_warning: Option<PersistDepth>,
pub orderbook_l3: Option<PersistDepth>,
}Expand description
Per-kind persistence toggles.
None means “do not persist this kind”. Some(depth) means persist at the
given depth. Master enabled gates everything; individual kinds can still be
Some(_) but produce no writes when enabled = false.
All fields that previously existed as bool now carry
Option<PersistDepth>. For backward compatibility:
DefaultproducesNonefor every kind (same as all-falsebefore).PersistenceConfig::on()sets every field toSome(Compact)— identical behavior to the previoustrue/ all-on path.
Fields§
§enabled: bool§retention_days: Option<u32>Sweep window for day files, in days. None = keep every day file
forever (default, no behavior change). Some(n) deletes .dat/.idx/
.blob triplets older than today - n on DiskStore open and on UTC
day rotation — see crate::series::DiskStore.
trades: Option<PersistDepth>§agg_trades: Option<PersistDepth>§klines: Option<PersistDepth>§tickers: Option<PersistDepth>§orderbook_snapshots: Option<PersistDepth>§orderbook_deltas: Option<PersistDepth>§mark_price: Option<PersistDepth>§funding_rate: Option<PersistDepth>§open_interest: Option<PersistDepth>§liquidations: Option<PersistDepth>§index_price: Option<PersistDepth>§block_trade: Option<PersistDepth>§auction_event: Option<PersistDepth>§composite_index: Option<PersistDepth>§volatility_index: Option<PersistDepth>§historical_volatility: Option<PersistDepth>§long_short_ratio: Option<PersistDepth>§taker_volume: Option<PersistDepth>§liquidation_bucket: Option<PersistDepth>§basis: Option<PersistDepth>§insurance_fund: Option<PersistDepth>§settlement_event: Option<PersistDepth>§predicted_funding: Option<PersistDepth>§funding_settlement: Option<PersistDepth>§risk_limit: Option<PersistDepth>§option_greeks: Option<PersistDepth>§mark_price_kline: Option<PersistDepth>§index_price_kline: Option<PersistDepth>§market_warning: Option<PersistDepth>§orderbook_l3: Option<PersistDepth>Implementations§
Source§impl PersistenceConfig
impl PersistenceConfig
Sourcepub fn on() -> Self
pub fn on() -> Self
Enable persistence for every supported kind at Compact depth.
Produces identical output to the previous on() that set all bools to
true. Compact = existing <Kind>Point layout, no behavior change.
Sourcepub fn retention_days(self, days: Option<u32>) -> Self
pub fn retention_days(self, days: Option<u32>) -> Self
Set the day-file retention window. None disables the sweep
(keep everything forever); Some(n) sweeps files older than
today - n days on DiskStore open + day rotation.
pub fn trades(self, depth: Option<PersistDepth>) -> Self
pub fn agg_trades(self, depth: Option<PersistDepth>) -> Self
pub fn klines(self, depth: Option<PersistDepth>) -> Self
pub fn tickers(self, depth: Option<PersistDepth>) -> Self
pub fn orderbook_snapshots(self, depth: Option<PersistDepth>) -> Self
pub fn orderbook_deltas(self, depth: Option<PersistDepth>) -> Self
pub fn mark_price(self, depth: Option<PersistDepth>) -> Self
pub fn funding_rate(self, depth: Option<PersistDepth>) -> Self
pub fn open_interest(self, depth: Option<PersistDepth>) -> Self
pub fn liquidations(self, depth: Option<PersistDepth>) -> Self
pub fn index_price(self, depth: Option<PersistDepth>) -> Self
pub fn block_trade(self, depth: Option<PersistDepth>) -> Self
pub fn auction_event(self, depth: Option<PersistDepth>) -> Self
pub fn composite_index(self, depth: Option<PersistDepth>) -> Self
pub fn volatility_index(self, depth: Option<PersistDepth>) -> Self
pub fn historical_volatility(self, depth: Option<PersistDepth>) -> Self
pub fn long_short_ratio(self, depth: Option<PersistDepth>) -> Self
pub fn taker_volume(self, depth: Option<PersistDepth>) -> Self
pub fn liquidation_bucket(self, depth: Option<PersistDepth>) -> Self
pub fn basis(self, depth: Option<PersistDepth>) -> Self
pub fn insurance_fund(self, depth: Option<PersistDepth>) -> Self
pub fn settlement_event(self, depth: Option<PersistDepth>) -> Self
pub fn predicted_funding(self, depth: Option<PersistDepth>) -> Self
pub fn funding_settlement(self, depth: Option<PersistDepth>) -> Self
pub fn risk_limit(self, depth: Option<PersistDepth>) -> Self
pub fn option_greeks(self, depth: Option<PersistDepth>) -> Self
pub fn mark_price_kline(self, depth: Option<PersistDepth>) -> Self
pub fn index_price_kline(self, depth: Option<PersistDepth>) -> Self
pub fn market_warning(self, depth: Option<PersistDepth>) -> Self
pub fn orderbook_l3(self, depth: Option<PersistDepth>) -> Self
Sourcepub fn is_enabled_for(&self, kind: &Kind) -> bool
pub fn is_enabled_for(&self, kind: &Kind) -> bool
Should kind be persisted given the current config?
Sourcepub fn depth_for(&self, kind: &Kind) -> Option<PersistDepth>
pub fn depth_for(&self, kind: &Kind) -> Option<PersistDepth>
The configured depth for kind, or None if persistence is disabled
for this kind (either master enabled=false or the kind’s toggle is
None).
Trait Implementations§
Source§impl Clone for PersistenceConfig
impl Clone for PersistenceConfig
Source§fn clone(&self) -> PersistenceConfig
fn clone(&self) -> PersistenceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more