summaryrefslogtreecommitdiffstats
path: root/crates/rebel-resolve/src/pin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rebel-resolve/src/pin.rs')
-rw-r--r--crates/rebel-resolve/src/pin.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/rebel-resolve/src/pin.rs b/crates/rebel-resolve/src/pin.rs
new file mode 100644
index 0000000..bffc940
--- /dev/null
+++ b/crates/rebel-resolve/src/pin.rs
@@ -0,0 +1,31 @@
+use std::collections::HashMap;
+
+use serde::{Deserialize, Serialize};
+
+use rebel_common::string_hash::*;
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub struct Args {
+ pub host: Option<String>,
+ pub target: Option<String>,
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub struct Provides {
+ pub recipe: String,
+ pub task: String,
+ pub output: Vec<String>,
+ pub args: Args,
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+#[serde(rename_all = "kebab-case")]
+pub struct Pin {
+ pub hash: Option<ArchiveHash>,
+ #[serde(default)]
+ pub provides: Vec<Provides>,
+ #[serde(default)]
+ pub is_rootfs: bool,
+}
+
+pub type Pins = HashMap<String, Pin>;