jetstream_oxide/events/
mod.rs

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
pub mod account;
pub mod commit;
pub mod identity;

use serde::Deserialize;

use crate::exports;

/// Basic data that is included with every event.
#[derive(Deserialize, Debug)]
pub struct EventInfo {
    pub did: exports::Did,
    pub time_us: u64,
    pub kind: EventKind,
}

#[derive(Deserialize, Debug)]
#[serde(untagged)]
pub enum JetstreamEvent {
    Commit(commit::CommitEvent),
    Identity(identity::IdentityEvent),
    Account(account::AccountEvent),
}

#[derive(Deserialize, Debug)]
#[serde(rename_all = "snake_case")]
pub enum EventKind {
    Commit,
    Identity,
    Account,
}