Skip to main content

PersistenceConfig

Struct PersistenceConfig 

Source
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:

  • Default produces None for every kind (same as all-false before).
  • PersistenceConfig::on() sets every field to Some(Compact) — identical behavior to the previous true / 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>§premium_index_kline: Option<PersistDepth>§market_warning: Option<PersistDepth>§orderbook_l3: Option<PersistDepth>

Implementations§

Source§

impl PersistenceConfig

Source

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.

Source

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.

Source

pub fn trades(self, depth: Option<PersistDepth>) -> Self

Source

pub fn agg_trades(self, depth: Option<PersistDepth>) -> Self

Source

pub fn klines(self, depth: Option<PersistDepth>) -> Self

Source

pub fn tickers(self, depth: Option<PersistDepth>) -> Self

Source

pub fn orderbook_snapshots(self, depth: Option<PersistDepth>) -> Self

Source

pub fn orderbook_deltas(self, depth: Option<PersistDepth>) -> Self

Source

pub fn mark_price(self, depth: Option<PersistDepth>) -> Self

Source

pub fn funding_rate(self, depth: Option<PersistDepth>) -> Self

Source

pub fn open_interest(self, depth: Option<PersistDepth>) -> Self

Source

pub fn liquidations(self, depth: Option<PersistDepth>) -> Self

Source

pub fn index_price(self, depth: Option<PersistDepth>) -> Self

Source

pub fn block_trade(self, depth: Option<PersistDepth>) -> Self

Source

pub fn auction_event(self, depth: Option<PersistDepth>) -> Self

Source

pub fn composite_index(self, depth: Option<PersistDepth>) -> Self

Source

pub fn volatility_index(self, depth: Option<PersistDepth>) -> Self

Source

pub fn historical_volatility(self, depth: Option<PersistDepth>) -> Self

Source

pub fn long_short_ratio(self, depth: Option<PersistDepth>) -> Self

Source

pub fn taker_volume(self, depth: Option<PersistDepth>) -> Self

Source

pub fn liquidation_bucket(self, depth: Option<PersistDepth>) -> Self

Source

pub fn basis(self, depth: Option<PersistDepth>) -> Self

Source

pub fn insurance_fund(self, depth: Option<PersistDepth>) -> Self

Source

pub fn settlement_event(self, depth: Option<PersistDepth>) -> Self

Source

pub fn predicted_funding(self, depth: Option<PersistDepth>) -> Self

Source

pub fn funding_settlement(self, depth: Option<PersistDepth>) -> Self

Source

pub fn risk_limit(self, depth: Option<PersistDepth>) -> Self

Source

pub fn option_greeks(self, depth: Option<PersistDepth>) -> Self

Source

pub fn mark_price_kline(self, depth: Option<PersistDepth>) -> Self

Source

pub fn index_price_kline(self, depth: Option<PersistDepth>) -> Self

Source

pub fn premium_index_kline(self, depth: Option<PersistDepth>) -> Self

Source

pub fn market_warning(self, depth: Option<PersistDepth>) -> Self

Source

pub fn orderbook_l3(self, depth: Option<PersistDepth>) -> Self

Source

pub fn is_enabled_for(&self, kind: &Kind) -> bool

Should kind be persisted given the current config?

Source

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

Source§

fn clone(&self) -> PersistenceConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PersistenceConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PersistenceConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PersistenceConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PersistenceConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more