Skip to main content

kobo_db_tools/model/
app_event.rs

1use chrono::{DateTime, Utc};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4pub enum AppEventKind {
5    AppStart,
6    PluggedIn,
7}
8
9#[derive(Debug, Clone)]
10pub struct AppEvent {
11    pub kind: AppEventKind,
12    pub timestamp: DateTime<Utc>,
13    pub attributes: Option<serde_json::Value>,
14}
15
16impl AppEvent {
17    pub fn new(
18        kind: AppEventKind,
19        timestamp: DateTime<Utc>,
20        attributes: Option<serde_json::Value>,
21    ) -> Self {
22        Self {
23            kind,
24            timestamp,
25            attributes,
26        }
27    }
28}