pub trait Phase<S: PlanningSolution, D: Director<S>, BestCb: ProgressCallback<S> = ()>: Send + Debug {
// Required methods
fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D, BestCb>);
fn phase_type_name(&self) -> &'static str;
// Provided methods
fn on_solver_terminal(
&mut self,
_solver_scope: &mut SolverScope<'_, S, D, BestCb>,
) { ... }
fn candidate_trace_plan(&self) -> CandidateTracePhasePlan { ... }
}Expand description
A phase of the solving process.
Phases are executed in sequence by the solver. Each phase has its own strategy for exploring or constructing solutions.
§Type Parameters
S- The planning solution typeD- The score director typeBestCb- The best-solution callback type (default())
Required Methods§
fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D, BestCb>)
fn phase_type_name(&self) -> &'static str
Provided Methods§
Sourcefn on_solver_terminal(
&mut self,
_solver_scope: &mut SolverScope<'_, S, D, BestCb>,
)
fn on_solver_terminal( &mut self, _solver_scope: &mut SolverScope<'_, S, D, BestCb>, )
Runs once when the enclosing solver reaches its terminal boundary.
The solver invokes this after it has attempted every configured
top-level phase and before it snapshots final statistics. It runs for
ordinary completion as well as cancellation or configured termination,
including phases whose Self::solve method was skipped. Implementors
can use it to publish terminal-only diagnostics; the default preserves
the existing phase lifecycle unchanged.
Sourcefn candidate_trace_plan(&self) -> CandidateTracePhasePlan
fn candidate_trace_plan(&self) -> CandidateTracePhasePlan
Returns the exact resolved-plan provenance this phase can prove.
A phase that does not override this method is deliberately marked opaque. Candidate traces must never synthesize a lookalike plan for custom or foreign phases; a consumer can then reject that comparison rather than accepting a misleading fallback.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".