CompositeStrategy

Struct CompositeStrategy 

Source
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>

Source

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 + Clone, S2: Strategy + Clone> Clone for CompositeStrategy<S1, S2>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S1: Strategy, S2: Strategy> Strategy for CompositeStrategy<S1, S2>

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. Read more

Auto Trait Implementations§

§

impl<S1, S2> Freeze for CompositeStrategy<S1, S2>
where S1: Freeze, S2: Freeze,

§

impl<S1, S2> RefUnwindSafe for CompositeStrategy<S1, S2>

§

impl<S1, S2> Send for CompositeStrategy<S1, S2>
where S1: Send, S2: Send,

§

impl<S1, S2> Sync for CompositeStrategy<S1, S2>
where S1: Sync, S2: Sync,

§

impl<S1, S2> Unpin for CompositeStrategy<S1, S2>
where S1: Unpin, S2: Unpin,

§

impl<S1, S2> UnwindSafe for CompositeStrategy<S1, S2>
where S1: UnwindSafe, S2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V