notebook_types/v0/
model.rs

1use serde::{Deserialize, Serialize};
2use tsify::Tsify;
3
4use super::path::Path;
5use uuid::Uuid;
6
7/// An object in a model of a double theory.
8#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Tsify)]
9#[serde(tag = "tag", content = "content")]
10#[tsify(into_wasm_abi, from_wasm_abi)]
11pub enum Ob {
12    /// Basic or generating object.
13    Basic(Uuid),
14
15    /// Morphism viewed as an object of a tabulator.
16    Tabulated(Mor),
17}
18
19/// A morphism in a model of a double theory.
20#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Tsify)]
21#[serde(tag = "tag", content = "content")]
22#[tsify(into_wasm_abi, from_wasm_abi)]
23pub enum Mor {
24    /// Basic or generating morphism.
25    Basic(Uuid),
26
27    /// Composite of morphisms.
28    Composite(Box<Path<Ob, Mor>>),
29
30    /// Morphism between tabulated morphisms, a commutative square.
31    TabulatorSquare {
32        dom: Box<Mor>,
33        cod: Box<Mor>,
34        pre: Box<Mor>,
35        post: Box<Mor>,
36    },
37}