aboutsummaryrefslogtreecommitdiff
path: root/rif/src/schema.rs
blob: ac3052ebb7274f7b14eb931001bf6b387696abab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use identity::Identity as Id;
use std::collections::BTreeSet;

/// A schema format backing a recipe set
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct Schema {
    /// Set of ingredients present in a recipe
    pub ingredients: BTreeSet<Ingredient>,
    /// Set of allowed work-steps in a recipe
    pub worksteps: BTreeSet<Workstep>,
}

#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct Ingredient {
    pub name: String,
    pub slug: String,
    pub id: Id,
}

/// An execution step
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct Workstep {
    pub id: Id,
    pub name: String,
    pub slug: String,
    pub description: String,
}

/// A piece of gear required to execute an action
pub struct Material {
    pub id: Id,
    pub name: String,
    pub slug: String,
    pub description: String,
}