summaryrefslogtreecommitdiffstats
path: root/crates/rebel-resolve/src/pin.rs
blob: bffc94017e8262284aca6346be3d14f5f631bda3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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>;