pub struct StrategicSolver<S: Strategy> { /* private fields */ }
Expand description
A partial Solver which uses a Strategy to solve a Sudoku as well as
possible. If it finds a contradiction, it will conclude that the Sudoku is
impossible. If it cannot solve it, it will resort to returning
Solution::Ambiguous
. Only if the wrapped strategy is able to solve the
Sudoku completely, a Solution::Unique
variant is returned.
Implementations§
Source§impl<S: Strategy> StrategicSolver<S>
impl<S: Strategy> StrategicSolver<S>
Sourcepub fn new(strategy: S) -> StrategicSolver<S>
pub fn new(strategy: S) -> StrategicSolver<S>
Creates a new strategic solver that uses the given strategy
to
attempt to solve Sudoku.
Trait Implementations§
Source§impl<S: Strategy> Solver for StrategicSolver<S>
impl<S: Strategy> Solver for StrategicSolver<S>
Source§fn solve(&self, sudoku: &Sudoku<impl Constraint + Clone>) -> Solution
fn solve(&self, sudoku: &Sudoku<impl Constraint + Clone>) -> Solution
Solves, or attempts to solve, the provided Sudoku. If the solver cannot
prove that a Sudoku is impossible or uniquely solveable (either
because it isn’t or the solver is not powerful enough), they shall
return
Solution::Ambiguous
.Auto Trait Implementations§
impl<S> Freeze for StrategicSolver<S>where
S: Freeze,
impl<S> RefUnwindSafe for StrategicSolver<S>where
S: RefUnwindSafe,
impl<S> Send for StrategicSolver<S>where
S: Send,
impl<S> Sync for StrategicSolver<S>where
S: Sync,
impl<S> Unpin for StrategicSolver<S>where
S: Unpin,
impl<S> UnwindSafe for StrategicSolver<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more