ExactCover

Trait ExactCover 

Source
pub trait ExactCover {
    type Possibility: Debug;
    type Constraint: Debug;

    // Required methods
    fn satisfies(
        &self,
        poss: &Self::Possibility,
        cons: &Self::Constraint,
    ) -> bool;
    fn is_optional(&self, cons: &Self::Constraint) -> bool;
    fn possibilities(&self) -> &[Self::Possibility];
    fn constraints(&self) -> &[Self::Constraint];

    // Provided method
    fn solver(&self) -> Solver<'_, Self> 
       where Self: Sized { ... }
}
Expand description

An instance of an exact cover problem.

Required Associated Types§

Source

type Possibility: Debug

The type of values that are elements of a solution to the exact cover problem.

Source

type Constraint: Debug

The type of value that are constraints on a given instance of an exact cover problem.

Required Methods§

Source

fn satisfies(&self, poss: &Self::Possibility, cons: &Self::Constraint) -> bool

Return true if the given Possibility will satisfy the given Constraint.

Source

fn is_optional(&self, cons: &Self::Constraint) -> bool

Return true if the given Constraint is optional.

Source

fn possibilities(&self) -> &[Self::Possibility]

Return a list of possibilities for this instance of the problem.

Source

fn constraints(&self) -> &[Self::Constraint]

Return a list of constraints that must be satisfied for this instance of the problem.

Provided Methods§

Source

fn solver(&self) -> Solver<'_, Self>
where Self: Sized,

Return an iterator over all solutions to this instance of the exact cover problem.

Implementors§