summaryrefslogtreecommitdiffstats
path: root/src/types.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-09-19 20:11:31 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-09-19 20:11:31 +0200
commitd644ecdcec86b6898ef6d9d8805652f204c63df1 (patch)
treef0ff36c5c4a89960afcaa08c008418afa966e124 /src/types.rs
parentfc4b06f1eac4c5e8ba1b7ebddc02a2c49e5220fb (diff)
downloadrebel-d644ecdcec86b6898ef6d9d8805652f204c63df1.tar
rebel-d644ecdcec86b6898ef6d9d8805652f204c63df1.zip
Use template variables instead of environment, parametrize all examples
This implements passing of various pieces of information through task arguments, as well as argument inheritance through different kinds of dependencies.
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/types.rs b/src/types.rs
index 25f21d3..d9a7b28 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -1,6 +1,7 @@
+use std::{borrow::Borrow, fmt::Display};
+
use serde::{Deserialize, Serialize};
use sha2::Sha256;
-use std::{collections::HashMap, fmt::Display, hash, rc::Rc};
use crate::util::cjson;
@@ -67,14 +68,9 @@ impl Display for TaskID {
}
}
-#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
-pub struct TaskArgs(pub HashMap<String, Rc<serde_json::Value>>);
-
-impl hash::Hash for TaskArgs {
- fn hash<H: hash::Hasher>(&self, _state: &mut H) {
- // Don't do anything: Properly hashing the task args is likely to cost
- // much more performance than the hash collisions caused by TaskRefs
- // that only differ by the args
+impl Borrow<str> for TaskID {
+ fn borrow(&self) -> &str {
+ &self.0
}
}