summaryrefslogtreecommitdiffstats
path: root/src/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/types.rs b/src/types.rs
new file mode 100644
index 0000000..cb777f7
--- /dev/null
+++ b/src/types.rs
@@ -0,0 +1,20 @@
+use serde::Deserialize;
+use std::collections::HashMap;
+
+pub type TaskRef = String;
+
+#[derive(Clone, Debug, Deserialize)]
+pub struct Task {
+ #[serde(default)]
+ pub depends: Vec<TaskRef>,
+ pub run: String,
+}
+
+#[derive(Default)]
+pub struct TaskMap(pub HashMap<String, Task>);
+
+impl TaskMap {
+ pub fn get(&self, task: &TaskRef) -> Option<&Task> {
+ self.0.get(task)
+ }
+}