pub struct ConstraintSet { /* private fields */ }
Expand description
A set of Constraint
s that can be used to filter the Word
s in a Wordlist
Implementations§
Source§impl ConstraintSet
impl ConstraintSet
Sourcepub fn iter(&self) -> Iter<'_, Constraint>
pub fn iter(&self) -> Iter<'_, Constraint>
Returns an iterator over the constraints in the set.
Sourcepub fn is_match(&self, word: &Word) -> bool
pub fn is_match(&self, word: &Word) -> bool
Returns true if the given word
complies to all the constraints in the set.
Sourcepub fn correct_word(&self) -> bool
pub fn correct_word(&self) -> bool
Returns true
if the ConstraintSet
encodes a correct guess, i.e. all the characters
are at the correct position (corresponds to the code GGGGG
).
Trait Implementations§
Source§impl Debug for ConstraintSet
impl Debug for ConstraintSet
Source§impl Hash for ConstraintSet
impl Hash for ConstraintSet
Source§impl<'a> IntoIterator for &'a ConstraintSet
impl<'a> IntoIterator for &'a ConstraintSet
Source§impl IntoIterator for ConstraintSet
impl IntoIterator for ConstraintSet
Source§impl PartialEq for ConstraintSet
impl PartialEq for ConstraintSet
impl Eq for ConstraintSet
impl StructuralPartialEq for ConstraintSet
Auto Trait Implementations§
impl Freeze for ConstraintSet
impl RefUnwindSafe for ConstraintSet
impl Send for ConstraintSet
impl Sync for ConstraintSet
impl Unpin for ConstraintSet
impl UnwindSafe for ConstraintSet
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more