sandbox_quant/storage/event_log.rs
1use crate::storage::models::EventRecord;
2
3#[derive(Debug, Default, Clone, PartialEq)]
4pub struct EventLog {
5 pub records: Vec<EventRecord>,
6}
7
8impl EventLog {
9 pub fn append(&mut self, record: EventRecord) {
10 self.records.push(record);
11 }
12}
13
14pub fn log(event_log: &mut EventLog, kind: impl Into<String>, payload: serde_json::Value) {
15 event_log.append(EventRecord {
16 kind: kind.into(),
17 payload,
18 });
19}