pub struct Possibility {
pub row: usize,
pub column: usize,
pub value: usize,
}Expand description
A position and value for a box inside of a Latin square puzzle.
Fields§
§row: usizeThe row position of the box.
The values ranges from 0 to side_length - 1.
column: usizeThe column position of the box.
The values ranges from 0 to side_length - 1.
value: usizeThe value present inside of the box.
The values ranges from 1 to side_length.
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 possible Possibilitys for the given
side_length.
Sourcepub fn satisfied_constraints(self) -> impl Iterator<Item = Constraint>
pub fn satisfied_constraints(self) -> impl Iterator<Item = Constraint>
Return an iterator over all Constraints that are satisfied by this
Possibility.
Sourcepub fn satisfies(&self, constraint: &Constraint) -> bool
pub fn satisfies(&self, constraint: &Constraint) -> bool
Return true if this Possibility satisfies the given Constraint.
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 From<Possibility> for Possibility
impl From<Possibility> for Possibility
Source§fn from(src: Possibility) -> Self
fn from(src: Possibility) -> Self
Converts to this type from the input type.
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