struct Bar { open: f64, high: f64, low: f64, close: f64, volume: Option<u32>, } struct Trade { price: f64, size: u32, } struct Quote { ask: f64, ask_size: u32, bid: f64, bid_size: u32, } enum Price { Bar(Bar), Trade(Trade), Quote(Quote), } trait MarketData { fn prices(&self) -> &HashMap<&'static str, Price>; fn timestamp(&self) -> &OffsetDateTime; }