winbrew_models\install/model.rs
1use crate::shared::HashAlgorithm;
2
3/// Failure buckets used by install orchestration and user-facing errors.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum InstallFailureClass {
6 /// Failure while checking preconditions.
7 Preflight,
8 /// Failure while verifying a downloaded artifact.
9 Verification,
10 /// Failure while transitioning install state in storage.
11 StateTransition,
12 /// Failure due to cancellation.
13 Cancelled,
14 /// Failure caused by a runtime engine error.
15 Runtime,
16}
17
18/// The successful result of an install flow.
19#[derive(Debug, Clone)]
20pub struct InstallResult {
21 /// Package name reported by the install flow.
22 pub name: String,
23 /// Package version reported by the install flow.
24 pub version: String,
25 /// Final install directory reported by the engine after installation.
26 pub install_dir: String,
27}
28
29/// Full outcome of an install attempt.
30#[derive(Debug, Clone)]
31pub struct InstallOutcome {
32 /// Successful install result.
33 pub result: InstallResult,
34 /// Legacy checksum algorithms encountered during verification.
35 pub legacy_checksum_algorithms: Vec<HashAlgorithm>,
36}