pub enum Constraint {
Row {
index: usize,
},
Column {
index: usize,
},
LeadingDiagonal {
index: usize,
},
TrailingDiagonal {
index: usize,
},
}Expand description
A condition which must be satisfied in order to solve an n queens puzzle.
Variants§
Row
A condition that a given row should have exactly one queen.
Column
A condition that a given column should have exactly one queen.
LeadingDiagonal
A condition that a leading diagonal should have at most one queen.
TrailingDiagonal
A condition that a trailing diagonal should have at most one queen.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn all(side_length: usize) -> impl Iterator<Item = Constraint>
pub fn all(side_length: usize) -> impl Iterator<Item = Constraint>
Return an iterator over all possible Constraints for a given
side_length.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Constraint
impl Debug for Constraint
Source§impl Hash for Constraint
impl Hash for Constraint
Source§impl Ord for Constraint
impl Ord for Constraint
Source§fn cmp(&self, other: &Constraint) -> Ordering
fn cmp(&self, other: &Constraint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
Source§impl PartialOrd for Constraint
impl PartialOrd for Constraint
impl Copy for Constraint
impl Eq for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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