1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Unified time-series infrastructure for Station data-classes.
//!
//! All Station-managed market data — trades, bars, orderbook snapshots,
//! tickers, mark prices, funding rates, open interest, liquidations, agg
//! trades — flows through the same plumbing:
//!
//! ```text
//! WS event ──► forwarder ──► Series<T>.push(memory ring)
//! ├─► DiskStore<T>.append (fixed-record binary)
//! └─► broadcast::Sender ──► consumer
//!
//! subscribe ──► Series<T>.seed_from_disk() ──► emit LastN immediately
//! └─► then attach to live stream
//! ```
//!
//! The key abstraction is [`DataPoint`] — each market data type provides a
//! fixed-size on-disk encoding + an extractor from `StreamEvent`. Series and
//! DiskStore are generic over `DataPoint`.
//!
//! Pattern borrowed from `mylittlechart::bar-service` (SharedSeriesMap +
//! seed_from_disk + flush_dirty), generalized over data-class.
// DiskStore: cfg-split between native (std::fs blocking I/O) and wasm32
// (OPFS via async createWritable). Both expose the same struct name so call
// sites compile against either platform without source changes.
// The wasm implementation lives in store_wasm.rs; the #[path] alias exposes it
// as `store` so `pub use store::DiskStore` works unchanged on both targets.
pub use DataPoint;
pub use ;
pub use SharedSeriesMap;
pub use ;
// PollSpec is wasm-safe (pure Duration + u8).
pub use PollSpec;
// DiskStore is available on both targets now.
pub use DiskStore;