use crate::{Ingredient, Workstep}; use std::collections::BTreeSet; #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Thread { pub name: String, pub instructions: Vec, pub inputs: BTreeSet, pub outputs: BTreeSet, } /// An ingredient with precise attached measurements #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Measure { /// Base ingredient from the schema pub ingredient: Ingredient, /// Numerical amount pub amount: usize, /// Scale offset pub scale: u64, } /// Differentiator between raw schema ingredient or work result pub enum IngredientLike { /// An ingredient backed by the recipe schema Raw(Ingredient), /// An ingredient produced by a subset of the recipe Combine(Combine), } /// A specific variation of a `Workstep` which acts on Measures #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Instruction {} /// The result of an instruction, which is not a base ingredient #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Combine { inputs: BTreeSet, name: String, slug: String, }