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§
Sourcetype Possibility: Debug
type Possibility: Debug
The type of values that are elements of a solution to the exact cover problem.
Sourcetype Constraint: Debug
type Constraint: Debug
The type of value that are constraints on a given instance of an exact cover problem.
Required Methods§
Sourcefn satisfies(&self, poss: &Self::Possibility, cons: &Self::Constraint) -> bool
fn satisfies(&self, poss: &Self::Possibility, cons: &Self::Constraint) -> bool
Return true if the given Possibility will satisfy the given
Constraint.
Sourcefn is_optional(&self, cons: &Self::Constraint) -> bool
fn is_optional(&self, cons: &Self::Constraint) -> bool
Return true if the given Constraint is optional.
Sourcefn possibilities(&self) -> &[Self::Possibility]
fn possibilities(&self) -> &[Self::Possibility]
Return a list of possibilities for this instance of the problem.
Sourcefn constraints(&self) -> &[Self::Constraint]
fn constraints(&self) -> &[Self::Constraint]
Return a list of constraints that must be satisfied for this instance of the problem.