add some comments
This commit is contained in:
parent
dd4961c6e7
commit
d71c4b015a
1 changed files with 12 additions and 0 deletions
|
|
@ -14,6 +14,15 @@ struct Args {
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize)]
|
#[derive(Debug, serde::Deserialize)]
|
||||||
struct Input {
|
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>,
|
quantity: Option<usize>,
|
||||||
amount: Option<String>,
|
amount: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
@ -36,7 +45,10 @@ struct Action {
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize)]
|
#[derive(Debug, serde::Deserialize)]
|
||||||
struct Recipe {
|
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>,
|
inputs: std::collections::HashMap<String, Input>,
|
||||||
|
|
||||||
dependencies: Dependencies,
|
dependencies: Dependencies,
|
||||||
action: Action,
|
action: Action,
|
||||||
outputs: Option<Vec<String>>,
|
outputs: Option<Vec<String>>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue