harmony/adr/003-abstractions/topology2/src/main_v1.rs
Jean-Gabriel Gill-Couture 00e71b97f6
All checks were successful
Run Check Script / check (push) Successful in 1m49s
Run Check Script / check (pull_request) Successful in 1m48s
chore: Move ADR helper files into folders with their corresponding ADR number
2025-06-09 13:54:23 -04:00

35 lines
606 B
Rust

fn main() {}
trait Topology {}
struct DummyTopology {}
impl Topology for DummyTopology {}
impl Topology for LampTopology {}
struct LampTopology {}
struct Maestro {
topology: Box<dyn Topology>,
}
trait Score {
type Topology: Topology;
fn execute(&self, topology: &Self::Topology);
}
struct K8sScore {}
impl Score for K8sScore {
type Topology = LampTopology;
fn execute(&self, topology: &Box<dyn Self::Topology>) {
todo!()
}
}
impl Maestro {
pub fn execute<T: Topology>(&self, score: Box<dyn Score<Topology = T>>) {
score.execute(&self.topology);
}
}