Struct sudoku_variants::constraint::DynamicConstraint [−][src]
A Constraint that contains a vector of trait objects representing constraints and verifies all of them. This is more flexible than a CompositeConstraint, but also less efficient, since it needs dynamic dispatch.
Implementations
impl DynamicConstraint
[src]
pub fn with_children(
constraints: Vec<Box<dyn CloneConstraint>>
) -> DynamicConstraint
[src]
constraints: Vec<Box<dyn CloneConstraint>>
) -> DynamicConstraint
Creates a new dynamic constraint from the given child constraints. The created constraint is defined to be satisfied if all children are satisfied.
pub fn new() -> DynamicConstraint
[src]
Creates a new dynamic constraint without any child constraint. Children can be added later using DynamicConstraint::add.
pub fn add(&mut self, constraint: impl CloneConstraint + 'static)
[src]
Adds a CloneConstraint to this dynamic constraint as a child. It is wrapped in a trait object.
Trait Implementations
impl Clone for DynamicConstraint
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Constraint for DynamicConstraint
[src]
fn check(&self, grid: &SudokuGrid) -> bool
[src]
fn check_cell(&self, grid: &SudokuGrid, column: usize, row: usize) -> bool
[src]
fn check_number(
&self,
grid: &SudokuGrid,
column: usize,
row: usize,
number: usize
) -> bool
[src]
&self,
grid: &SudokuGrid,
column: usize,
row: usize,
number: usize
) -> bool
fn get_groups(&self, grid: &SudokuGrid) -> Vec<Group>
[src]
impl Default for DynamicConstraint
[src]
fn default() -> DynamicConstraint
[src]
Auto Trait Implementations
impl !RefUnwindSafe for DynamicConstraint
impl !Send for DynamicConstraint
impl !Sync for DynamicConstraint
impl Unpin for DynamicConstraint
impl !UnwindSafe for DynamicConstraint
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<C> CloneConstraint for C where
C: 'static + Constraint + Clone,
[src]
C: 'static + Constraint + Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,