tandem_types/event.rs
1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct EngineEvent {
6 #[serde(rename = "type")]
7 pub event_type: String,
8 #[serde(default)]
9 pub properties: Value,
10}
11
12impl EngineEvent {
13 pub fn new(event_type: impl Into<String>, properties: Value) -> Self {
14 Self {
15 event_type: event_type.into(),
16 properties,
17 }
18 }
19}