co_primitives/types/
guard.rs1use crate::Tags;
5use cid::Cid;
6use serde::{Deserialize, Serialize};
7use std::collections::BTreeSet;
8
9#[derive(Debug, Serialize, Deserialize)]
10pub struct GuardInput {
11 pub guard: String,
13
14 pub state: Cid,
16
17 pub heads: BTreeSet<Cid>,
19
20 pub next_head: Cid,
22}
23
24#[derive(Debug, Serialize, Deserialize)]
25pub struct GuardOutput {
26 pub result: bool,
28
29 #[serde(default, skip_serializing_if = "Option::is_none")]
31 pub error: Option<String>,
32
33 #[serde(default, skip_serializing_if = "Tags::is_empty")]
35 pub tags: Tags,
36}