pub struct Possibility {
pub row: usize,
pub column: usize,
}Expand description
A position on the chess board.
Fields§
§row: usizeThe row index, ranging from 0 to n - 1.
column: usizeThe column index, ranging form 0 to n - 1.
Implementations§
Source§impl Possibility
impl Possibility
Sourcepub fn all(side_length: usize) -> impl Iterator<Item = Self>
pub fn all(side_length: usize) -> impl Iterator<Item = Self>
Return an iterator over all positions on the chess board for a given side length.
Sourcepub fn leading_diagonal(self, side_length: usize) -> usize
pub fn leading_diagonal(self, side_length: usize) -> usize
Return the leading diagonal index for a given side length.
This value ranges from 0 to n - 2.
Sourcepub fn trailing_diagonal(self) -> usize
pub fn trailing_diagonal(self) -> usize
Return the trailing diagonal index.
The value ranges from 0 to n - 2.
Sourcepub fn satisfied_constraints(
self,
side_length: usize,
) -> impl Iterator<Item = Constraint>
pub fn satisfied_constraints( self, side_length: usize, ) -> impl Iterator<Item = Constraint>
Return an iterator over all the Constraints that are satisfied by this
Possibility.
Trait Implementations§
Source§impl Clone for Possibility
impl Clone for Possibility
Source§fn clone(&self) -> Possibility
fn clone(&self) -> Possibility
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 Possibility
impl Debug for Possibility
Source§impl Hash for Possibility
impl Hash for Possibility
Source§impl Ord for Possibility
impl Ord for Possibility
Source§fn cmp(&self, other: &Possibility) -> Ordering
fn cmp(&self, other: &Possibility) -> 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 Possibility
impl PartialEq for Possibility
Source§impl PartialOrd for Possibility
impl PartialOrd for Possibility
impl Copy for Possibility
impl Eq for Possibility
impl StructuralPartialEq for Possibility
Auto Trait Implementations§
impl Freeze for Possibility
impl RefUnwindSafe for Possibility
impl Send for Possibility
impl Sync for Possibility
impl Unpin for Possibility
impl UnwindSafe for Possibility
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