Struct rs_wordle_solver::GuessResult
source · pub struct GuessResult<'a> {
pub guess: &'a str,
pub results: Vec<LetterResult>,
}
Expand description
The result of a single word guess.
There is some complexity here when the guess has duplicate letters. Duplicate letters are
matched to LetterResult
s as follows:
- All letters in the correct location are marked
Correct
. - For any remaining letters, if the objective word has more letters than were marked correct,
then these letters are marked as
PresentNotHere
starting from the beginning of the word, until all letters have been accounted for. - Any remaining letters are marked as
NotPresent
.
For example, if the guess was “sassy” for the objective word “mesas”, then the results would
be: [PresentNotHere, PresentNotHere, Correct, NotPresent, NotPresent]
.
Fields§
§guess: &'a str
The guess that was made.
results: Vec<LetterResult>
The result of each letter, provided in the same leter order as in the guess.
Trait Implementations§
source§impl<'a> Clone for GuessResult<'a>
impl<'a> Clone for GuessResult<'a>
source§fn clone(&self) -> GuessResult<'a>
fn clone(&self) -> GuessResult<'a>
Returns a copy 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<'a> Debug for GuessResult<'a>
impl<'a> Debug for GuessResult<'a>
source§impl<'a> Hash for GuessResult<'a>
impl<'a> Hash for GuessResult<'a>
source§impl<'a> PartialEq for GuessResult<'a>
impl<'a> PartialEq for GuessResult<'a>
source§fn eq(&self, other: &GuessResult<'a>) -> bool
fn eq(&self, other: &GuessResult<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> StructuralPartialEq for GuessResult<'a>
Auto Trait Implementations§
impl<'a> Freeze for GuessResult<'a>
impl<'a> RefUnwindSafe for GuessResult<'a>
impl<'a> Send for GuessResult<'a>
impl<'a> Sync for GuessResult<'a>
impl<'a> Unpin for GuessResult<'a>
impl<'a> UnwindSafe for GuessResult<'a>
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