mongreldb-kit-core 0.15.0

Core, language-neutral model for MongrelDB Kit: schema, key encoding, validation, constraint planning, migration planning, and query AST.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TriggerSpec {
    pub json: serde_json::Value,
}

impl TriggerSpec {
    pub fn new(json: serde_json::Value) -> Self {
        Self { json }
    }

    pub fn canonical_json(&self) -> String {
        serde_json::to_string(&self.json).unwrap_or_else(|_| "null".into())
    }
}