harmony/harmony-rs/harmony/src/domain/maestro/mod.rs
Jean-Gabriel Gill-Couture f241bf793e fix(dhcp): remove unused IP range check and simplify DnsConfig
Remove the commented-out IP range validation in `DhcpConfig` and simplify the `DnsConfig` constructor by removing an unnecessary parameter, addressing several compiler warnings.
2025-01-12 15:32:14 -05:00

32 lines
765 B
Rust

use derive_new::new;
use log::info;
use super::{
interpret::{Interpret, InterpretError, Outcome},
inventory::Inventory,
score::Score,
topology::HAClusterTopology,
};
#[derive(new)]
pub struct Maestro {
inventory: Inventory,
topology: HAClusterTopology,
}
impl Maestro {
pub fn start(&mut self) {
info!("Starting Maestro");
}
pub async fn interpret<S: Score>(&self, score: S) -> Result<Outcome, InterpretError> {
info!("Running score {score:?}");
let interpret: S::InterpretType = score.create_interpret();
info!("Launching interpret {interpret:?}");
let result = interpret.execute(&self.inventory, &self.topology).await;
info!("Got result {result:?}");
result
}
}