pub struct CompositeStrategy<S1: Strategy, S2: Strategy> { /* private fields */ }
Expand description
A Strategy which uses two strategies by first applying one and then the other on the output of the first one. If any child changed the state, this strategy is defined to have changed the state aswell.
Implementations§
Source§impl<S1: Strategy, S2: Strategy> CompositeStrategy<S1, S2>
impl<S1: Strategy, S2: Strategy> CompositeStrategy<S1, S2>
Sourcepub fn new(s1: S1, s2: S2) -> CompositeStrategy<S1, S2>
pub fn new(s1: S1, s2: S2) -> CompositeStrategy<S1, S2>
Creates a new composite strategy from the two children strategies.
§Arguments
s1
: The strategy which is applied first.s2
: The strategy which is applied second.
Trait Implementations§
Source§impl<S1: Strategy, S2: Strategy> Strategy for CompositeStrategy<S1, S2>
impl<S1: Strategy, S2: Strategy> Strategy for CompositeStrategy<S1, S2>
Source§fn apply(&self, sudoku_info: &mut SudokuInfo<impl Constraint + Clone>) -> bool
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. Read moreAuto Trait Implementations§
impl<S1, S2> Freeze for CompositeStrategy<S1, S2>
impl<S1, S2> RefUnwindSafe for CompositeStrategy<S1, S2>where
S1: RefUnwindSafe,
S2: RefUnwindSafe,
impl<S1, S2> Send for CompositeStrategy<S1, S2>
impl<S1, S2> Sync for CompositeStrategy<S1, S2>
impl<S1, S2> Unpin for CompositeStrategy<S1, S2>
impl<S1, S2> UnwindSafe for CompositeStrategy<S1, S2>where
S1: UnwindSafe,
S2: 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