forked from NationTech/harmony
		
	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:
		
							parent
							
								
									9e456bb4f5
								
							
						
					
					
						commit
						452ebc2614
					
				| @ -19,6 +19,7 @@ pub enum InterpretName { | |||||||
|     Dummy, |     Dummy, | ||||||
|     Panic, |     Panic, | ||||||
|     OPNSense, |     OPNSense, | ||||||
|  |     K3dInstallation, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl std::fmt::Display for InterpretName { | impl std::fmt::Display for InterpretName { | ||||||
| @ -32,6 +33,7 @@ impl std::fmt::Display for InterpretName { | |||||||
|             InterpretName::Dummy => f.write_str("Dummy"), |             InterpretName::Dummy => f.write_str("Dummy"), | ||||||
|             InterpretName::Panic => f.write_str("Panic"), |             InterpretName::Panic => f.write_str("Panic"), | ||||||
|             InterpretName::OPNSense => f.write_str("OPNSense"), |             InterpretName::OPNSense => f.write_str("OPNSense"), | ||||||
|  |             InterpretName::K3dInstallation => f.write_str("K3dInstallation"), | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,6 +1,13 @@ | |||||||
|  | use async_trait::async_trait; | ||||||
| use serde::Serialize; | 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)] | #[derive(Debug, Clone, Serialize)] | ||||||
| pub struct K3DInstallationScore {} | pub struct K3DInstallationScore {} | ||||||
| @ -29,3 +36,29 @@ impl<T: Topology> Score<T> for K3DInstallationScore { | |||||||
|         todo!() |         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!() | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user