sofie_db/event.rs
1use serde::Serialize;
2
3use crate::Input;
4
5pub trait Event: Input + Serialize + Send + 'static {
6 /// `<crate>.<Type>`: what it is stored and delivered as.
7 const NAME: &'static str;
8}
9
10/// No field named in Rust can take it, and `Meta::raise` refuses an app event that does.
11pub(crate) const PRUNED: &str = "sofie.pruned";
12
13pub(crate) fn is_pruned(payload: &serde_json::Value) -> bool {
14 payload.get(PRUNED) == Some(&serde_json::Value::Bool(true))
15}