pub trait ColdStartPlanner {
// Required methods
fn initial_plan(&mut self, state: &dyn StateView) -> ColdStartPlan;
fn on_results(
&mut self,
results: &ColdStartResults,
state: &dyn StateView,
) -> ColdStartStep;
}Expand description
Drives a bounded multi-round cold start.
The driver calls initial_plan once, executes it, then
repeatedly calls on_results with the round’s results and
the post-injection StateView; a returned ColdStartStep::Continue is run
as the next round and ColdStartStep::Done ends the run. The loop is bounded
by ColdStartConfig::max_rounds.
Implementations perform no IO — the trait hands them only borrowed, read-only state, so all fetching is the driver’s responsibility.
Required Methods§
Sourcefn initial_plan(&mut self, state: &dyn StateView) -> ColdStartPlan
fn initial_plan(&mut self, state: &dyn StateView) -> ColdStartPlan
The first plan to execute, derived from the current cached state.
Sourcefn on_results(
&mut self,
results: &ColdStartResults,
state: &dyn StateView,
) -> ColdStartStep
fn on_results( &mut self, results: &ColdStartResults, state: &dyn StateView, ) -> ColdStartStep
Decide whether to continue (with a next plan) or finish, given the just- completed round’s results and the post-injection state view.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".