add some comments

This commit is contained in:
Sebastian Kuzminsky 2025-01-13 00:11:14 -07:00
parent dd4961c6e7
commit d71c4b015a

View file

@ -14,6 +14,15 @@ struct Args {
#[derive(Debug, serde::Deserialize)]
struct Input {
/// Each input has either a `quantity` (for discrete things, like
/// apples or bearings) or an `amount` (for continuous things,
/// like rope or flour).
///
/// FIXME: Is there a good way to handle the "units" of the
/// quantity/amount? Maybe the units could default to "count", but
/// be optionally overridden by the recipe to things like "meters"
/// (of tubing) or "grams" (of chromic acid). Then this struct
/// would be `quantity: usize, units: Option<Unit>`.
quantity: Option<usize>,
amount: Option<String>,
}
@ -36,7 +45,10 @@ struct Action {
#[derive(Debug, serde::Deserialize)]
struct Recipe {
/// `[inputs]` is a Table where each key the the name (unique id)
/// of a recipe in the repo, and the value is an Input object.
inputs: std::collections::HashMap<String, Input>,
dependencies: Dependencies,
action: Action,
outputs: Option<Vec<String>>,