pub trait SolutionCallback<B: Brancher, R: ConflictResolver> {
type Stop;
// Required method
fn on_solution_callback(
&mut self,
solver: &Solver,
solution: SolutionReference<'_>,
brancher: &B,
resolver: &R,
) -> ControlFlow<Self::Stop>;
}Expand description
Called during optimisation with every encountered solution.
The callback can determine whether to proceed optimising or whether to stop by returning a
ControlFlow value. When ControlFlow::Break is returned, a value of
SolutionCallback::Stop can be supplied that will be forwarded to the result of the
optimisation call.
Required Associated Types§
Required Methods§
Sourcefn on_solution_callback(
&mut self,
solver: &Solver,
solution: SolutionReference<'_>,
brancher: &B,
resolver: &R,
) -> ControlFlow<Self::Stop>
fn on_solution_callback( &mut self, solver: &Solver, solution: SolutionReference<'_>, brancher: &B, resolver: &R, ) -> ControlFlow<Self::Stop>
Called when a solution is encountered.