Skip to main content

mongreldb_kit_core/
procedure.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
4pub struct ProcedureSpec {
5    pub json: serde_json::Value,
6}
7
8impl ProcedureSpec {
9    pub fn new(json: serde_json::Value) -> Self {
10        Self { json }
11    }
12
13    pub fn canonical_json(&self) -> String {
14        serde_json::to_string(&self.json).unwrap_or_else(|_| "null".into())
15    }
16}