aboutsummaryrefslogtreecommitdiff
path: root/release/src/types.rs
blob: 56a886e6fe740e6592c5a94694611176ee34544e (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
32
33
use serde::Deserialize;
use std::collections::{BTreeMap, HashMap};
use std::path::PathBuf;

#[derive(Debug, Deserialize)]
pub struct ParsedCrate {
    pub package: ParsedPackage,
    pub dependencies: BTreeMap<String, toml::Value>,
}

#[derive(Debug, Deserialize)]
pub struct ParsedPackage {
    pub name: String,
    pub version: String,
}

#[derive(Debug, Clone, Deserialize)]
pub struct CrateConfig {
    pub features: Option<Vec<String>>,
    pub target: Option<String>,
}

pub type ReleaseConfig = HashMap<String, CrateConfig>;
pub type CrateId = String;

#[derive(Debug, Clone)]
pub struct Crate {
    pub name: String,
    pub version: String,
    pub path: PathBuf,
    pub config: CrateConfig,
    pub dependencies: Vec<CrateId>,
}