sofie-db 0.1.0

The handler model (inputs, events, replies), aggregates, read models, the query builder, the unit of work, migrations, the worker and the database seam.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde::Serialize;

use crate::Input;

pub trait Event: Input + Serialize + Send + 'static {
    /// `<crate>.<Type>`: what it is stored and delivered as.
    const NAME: &'static str;
}

/// No field named in Rust can take it, and `Meta::raise` refuses an app event that does.
pub(crate) const PRUNED: &str = "sofie.pruned";

pub(crate) fn is_pruned(payload: &serde_json::Value) -> bool {
    payload.get(PRUNED) == Some(&serde_json::Value::Bool(true))
}