nous/state/lib.rs
2025-09-10 22:39:34 +10:00

76 lines
973 B
Rust

use std::{
collections::{HashMap, HashSet},
path::PathBuf,
};
use nix_json_parser::Actions;
pub type Id = u64;
pub enum StorePath {
Downloading,
Uploading,
Downloaded,
Uploaded,
}
pub enum BuildStatus {
Planned,
Running,
Complete,
Failed,
}
pub enum Progress {
JustStarted,
InputReceived,
Finished,
}
pub enum OutputName {
Out,
Doc,
Dev,
Bin,
Info,
Lib,
Man,
Dist,
Other(String),
}
pub enum Host {
Local,
Host(String),
}
pub struct Derivation {
store_path: PathBuf,
}
pub struct BuildInfo {
start: f64,
host: Host,
estimate: Option<u64>,
activity_id: Id,
state: BuildStatus,
}
pub enum DependencyState {
Planned,
Running,
Completed,
}
pub struct Dependencies {
deps: HashMap<Id, BuildInfo>,
}
// #[derive(Default)]
pub struct State {
progress: Progress,
}
impl State {
pub fn imbibe(&mut self, update: Actions) {}
}