feat: add k3d installation interpret

Adds a new interpret for k3d installation. This includes defining the `K3dInstallationInterpret` struct, implementing the `Interpret` trait for it, and adding the `K3dInstallation` variant to the `InterpretName` enum. The implementation currently contains `todo!()` placeholders for the actual logic.
This commit is contained in:
Jean-Gabriel Gill-Couture 2025-04-19 15:25:16 -04:00
parent 9e456bb4f5
commit 452ebc2614
2 changed files with 36 additions and 1 deletions

View File

@ -19,6 +19,7 @@ pub enum InterpretName {
Dummy,
Panic,
OPNSense,
K3dInstallation,
}
impl std::fmt::Display for InterpretName {
@ -32,6 +33,7 @@ impl std::fmt::Display for InterpretName {
InterpretName::Dummy => f.write_str("Dummy"),
InterpretName::Panic => f.write_str("Panic"),
InterpretName::OPNSense => f.write_str("OPNSense"),
InterpretName::K3dInstallation => f.write_str("K3dInstallation"),
}
}
}

View File

@ -1,6 +1,13 @@
use async_trait::async_trait;
use serde::Serialize;
use crate::{score::Score, topology::Topology};
use crate::{
data::{Id, Version},
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
inventory::Inventory,
score::Score,
topology::Topology,
};
#[derive(Debug, Clone, Serialize)]
pub struct K3DInstallationScore {}
@ -29,3 +36,29 @@ impl<T: Topology> Score<T> for K3DInstallationScore {
todo!()
}
}
#[derive(Debug)]
struct K3dInstallationInterpret {}
#[async_trait]
impl<T: Topology> Interpret<T> for K3dInstallationInterpret {
async fn execute(
&self,
inventory: &Inventory,
topology: &T,
) -> Result<Outcome, InterpretError> {
todo!()
}
fn get_name(&self) -> InterpretName {
InterpretName::K3dInstallation
}
fn get_version(&self) -> Version {
todo!()
}
fn get_status(&self) -> InterpretStatus {
todo!()
}
fn get_children(&self) -> Vec<Id> {
todo!()
}
}