pub struct StationBuilder { /* private fields */ }Expand description
Fluent builder for Station.
Implementations§
Source§impl StationBuilder
impl StationBuilder
pub fn new() -> Self
Sourcepub fn storage_root(self, root: impl Into<PathBuf>) -> Self
pub fn storage_root(self, root: impl Into<PathBuf>) -> Self
Override the root directory under which all Station-managed artefacts (trades, bars, snapshots, indexes) are written.
Sourcepub fn persistence(self, cfg: PersistenceConfig) -> Self
pub fn persistence(self, cfg: PersistenceConfig) -> Self
Configure trade/bar/snapshot persistence.
Sourcepub fn warm_start(self, n: usize) -> Self
pub fn warm_start(self, n: usize) -> Self
Number of most-recent points to emit from disk on subscribe BEFORE live stream takes over. 0 disables warm-start. Acts as the in-memory series capacity too.
Sourcepub fn gap_heal(self, cfg: GapHealConfig) -> Self
pub fn gap_heal(self, cfg: GapHealConfig) -> Self
Configure proactive gap-heal: when a live event arrives whose timestamp jumps further than the configured threshold past the last seen event, the station REST-backfills the missing window before emitting the live event. Off by default.
On wasm32 the REST pull uses browser fetch; it succeeds for the 9 proxy-override venues (Binance/Bybit/OKX/Bitget/Bitstamp/Coinbase/Kraken/ Deribit/HTX) and silently returns an empty window for other venues until their REST CORS proxies are wired (Wave 4-C).
Sourcepub fn unsubscribe_grace(self, grace: Duration) -> Self
pub fn unsubscribe_grace(self, grace: Duration) -> Self
How long to keep a WS forwarder alive after its last consumer drops. During this window a new subscription for the same key reuses the live connection — no reconnect, no REST re-seed.
Default: Duration::ZERO (immediate drop, current behaviour).
Typical UI value: Duration::from_secs(30) so a quick symbol-flip
(BTC → ETH → BTC) stays on the same socket.
Sourcepub fn orderbook_rest_seed(self, enable: bool) -> Self
pub fn orderbook_rest_seed(self, enable: bool) -> Self
On first subscribe to an [Stream::Orderbook] or [Stream::OrderbookDelta]
stream for a (exchange, symbol, account) key, also issue a one-shot REST
get_orderbook call so the live book is seeded with up to depth levels
before WS deltas start applying.
Default: false (WS-only — matches pre-0.3.13 behaviour).
On failure (REST not connected, exchange returns error, empty snapshot) the station continues with WS-only and logs a warning. Never aborts the subscribe.
Sourcepub fn orderbook_seed_depth(self, depth: usize) -> Self
pub fn orderbook_seed_depth(self, depth: usize) -> Self
Depth of the REST seed snapshot. Only meaningful when
Self::orderbook_rest_seed is true.
Passed directly to get_orderbook(symbol, Some(depth as u16), account).
Clamped to 1..=u16::MAX internally.
Default: 1000.