solverforge_solver/manager/phase_factory_trait.rs
1//! PhaseFactory trait definition.
2
3use solverforge_core::domain::PlanningSolution;
4use solverforge_scoring::Director;
5
6use crate::phase::Phase;
7
8/// Factory trait for creating phases with zero type erasure.
9///
10/// Returns a concrete phase type via associated type, preserving
11/// full type information through the pipeline.
12///
13/// # Type Parameters
14///
15/// * `S` - The solution type
16/// * `D` - The score director type
17pub trait PhaseFactory<S, D>: Send + Sync
18where
19 S: PlanningSolution,
20 D: Director<S>,
21{
22 /// The concrete phase type produced by this factory.
23 type Phase: Phase<S, D>;
24
25 /// Creates a new phase instance with concrete type.
26 fn create(&self) -> Self::Phase;
27}