about summary refs log tree commit diff
path: root/tvix/derivation/src/output.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/derivation/src/output.rs')
-rw-r--r--tvix/derivation/src/output.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tvix/derivation/src/output.rs b/tvix/derivation/src/output.rs
new file mode 100644
index 000000000000..0d764011fc1c
--- /dev/null
+++ b/tvix/derivation/src/output.rs
@@ -0,0 +1,16 @@
+use serde::{Deserialize, Serialize};
+
+// This function is required by serde to deserialize files
+// with missing keys.
+fn default_resource() -> String {
+    "".to_string()
+}
+
+#[derive(Serialize, Deserialize)]
+pub struct Output {
+    pub path: String,
+    #[serde(default = "default_resource")]
+    pub hash_algorithm: String,
+    #[serde(default = "default_resource")]
+    pub hash: String,
+}