pub struct AllDifferent { /* private fields */ }
Implementations§
Source§impl AllDifferent
impl AllDifferent
Sourcepub fn new<'a, I>(vars: I) -> Selfwhere
I: IntoIterator<Item = &'a VarToken>,
pub fn new<'a, I>(vars: I) -> Selfwhere
I: IntoIterator<Item = &'a VarToken>,
Allocate a new All Different constraint.
§Examples
let mut send_more_money = puzzle_solver::Puzzle::new();
let vars = send_more_money.new_vars_with_candidates_1d(8,
&[0,1,2,3,4,5,6,7,8,9]);
puzzle_solver::constraint::AllDifferent::new(&vars);
Trait Implementations§
Source§impl Constraint for AllDifferent
impl Constraint for AllDifferent
Source§fn vars<'a>(&'a self) -> Box<dyn Iterator<Item = &'a VarToken> + 'a>
fn vars<'a>(&'a self) -> Box<dyn Iterator<Item = &'a VarToken> + 'a>
An iterator over the variables that are involved in the constraint.
Source§fn on_assigned(
&self,
search: &mut PuzzleSearch<'_>,
var: VarToken,
val: Val,
) -> PsResult<()>
fn on_assigned( &self, search: &mut PuzzleSearch<'_>, var: VarToken, val: Val, ) -> PsResult<()>
Applied after a variable has been assigned.
Source§fn on_updated(&self, search: &mut PuzzleSearch<'_>) -> PsResult<()>
fn on_updated(&self, search: &mut PuzzleSearch<'_>) -> PsResult<()>
Applied after a variable’s candidates has been modified.
Source§fn substitute(
&self,
from: VarToken,
to: VarToken,
) -> PsResult<Rc<dyn Constraint>>
fn substitute( &self, from: VarToken, to: VarToken, ) -> PsResult<Rc<dyn Constraint>>
Substitute the “from” variable with the “to” variable. Read more
Auto Trait Implementations§
impl Freeze for AllDifferent
impl RefUnwindSafe for AllDifferent
impl Send for AllDifferent
impl Sync for AllDifferent
impl Unpin for AllDifferent
impl UnwindSafe for AllDifferent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more