structs
This commit is contained in:
parent
160be2061f
commit
cff9f08ff4
45
src/structs.rs
Normal file
45
src/structs.rs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct System {
|
||||||
|
pub distro: String,
|
||||||
|
pub release: String,
|
||||||
|
pub arch: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct AptSource {
|
||||||
|
pub name: String,
|
||||||
|
pub uri: String,
|
||||||
|
pub suite: String,
|
||||||
|
pub components: Vec<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct Package {
|
||||||
|
pub name: String,
|
||||||
|
pub version: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct PinRule {
|
||||||
|
pub package: Package,
|
||||||
|
pub priority: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct Options {
|
||||||
|
pub include_dependencies: bool,
|
||||||
|
pub fail_on_missing: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
pub struct Config {
|
||||||
|
pub system: System,
|
||||||
|
pub apt_source: Vec<AptSource>,
|
||||||
|
pub packages: HashMap<String, String>, // name, version
|
||||||
|
|
||||||
|
pub pinned_packages: Vec<PinRule>,
|
||||||
|
pub options: Option<Options>,
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user