Strategy

Trait Strategy 

Source
pub trait Strategy {
    // Required method
    fn apply(
        &self,
        sudoku_info: &mut SudokuInfo<impl Constraint + Clone>,
    ) -> bool;
}
Expand description

A trait for strategies, which use logical reasoning to restrict the possibilities of a Sudoku.

Required Methods§

Source

fn apply(&self, sudoku_info: &mut SudokuInfo<impl Constraint + Clone>) -> bool

Applies this strategy to the given Sudoku. The strategy may rely on and modify the information in the given sudoku_info. This instance is given to other strategies that participate in the solution and/or future iterations of the same strategy. It can thus be used to communicate insights.

This method shall return true if and only if something has changed, that is, a digit has been entered or an option has been removed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§