pub struct State { /* private fields */ }
Implementations
sourceimpl State
impl State
sourcepub fn new(solution: String, word_set: WordSet<'static>) -> Self
pub fn new(solution: String, word_set: WordSet<'static>) -> Self
Create a new game state from the solution
sourcepub fn guesses(&self) -> StateIter<'_>ⓘNotable traits for StateIter<'a>impl<'a> Iterator for StateIter<'a> type Item = Guess<'a>;
pub fn guesses(&self) -> StateIter<'_>ⓘNotable traits for StateIter<'a>impl<'a> Iterator for StateIter<'a> type Item = Guess<'a>;
Returns an iterator over the previous guesses
sourcepub fn guess(&mut self, word: &str, hard: bool) -> Result<Matches, GuessError>
pub fn guess(&mut self, word: &str, hard: bool) -> Result<Matches, GuessError>
Make a guess.
Errors
If the guess is an invalid word, or if it doesn’t match the requirements of hard mode, this function will return an error
sourcepub fn display_score_card(&self, w: impl Write, hard: bool) -> Result
pub fn display_score_card(&self, w: impl Write, hard: bool) -> Result
Displays the score card for this game state to the given fmt::Write
.
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more