Struct sudoku_variants::constraint::DynamicConstraint[][src]

pub struct DynamicConstraint { /* fields omitted */ }

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]

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]

impl Constraint for DynamicConstraint[src]

impl Default for DynamicConstraint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<C> CloneConstraint for C where
    C: 'static + Constraint + Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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