pub struct Wordle { /* private fields */ }Expand description
An automaton that matches valid guesses
Implementations§
Source§impl Wordle
impl Wordle
Sourcepub const fn has_solution_at(&self, pos: usize) -> bool
pub const fn has_solution_at(&self, pos: usize) -> bool
Test if the automaton matches the solution for a single position
§Panics
Panics if the pos is out of bounds (5..)
Sourcepub fn decode(self) -> impl Iterator<Item = u8>
pub fn decode(self) -> impl Iterator<Item = u8>
Iterate over all bytes in the full solution
§Panics
Panics if the automaton does not have a solution, i.e. Wordle::is_solved() must return true
Sourcepub fn decode_str(self) -> String
pub fn decode_str(self) -> String
Create a new string from the full solution
§Panics
Panics if the automaton does not have a solution, i.e. Wordle::is_solved() must return true
Trait Implementations§
Source§impl Automaton for Wordle
impl Automaton for Wordle
Source§type State = Option<SolveState>
type State = Option<SolveState>
The type of the state used in the automaton.
Source§fn is_match(&self, state: &Self::State) -> bool
fn is_match(&self, state: &Self::State) -> bool
Returns true if and only if
state is a match state.Source§fn accept(&self, state: &Self::State, byte: u8) -> Self::State
fn accept(&self, state: &Self::State, byte: u8) -> Self::State
Return the next state given
state and an input.Source§fn can_match(&self, state: &Self::State) -> bool
fn can_match(&self, state: &Self::State) -> bool
Returns true if and only if
state can lead to a match in zero or more
steps. Read moreSource§fn will_always_match(&self, _state: &Self::State) -> bool
fn will_always_match(&self, _state: &Self::State) -> bool
Returns true if and only if
state matches and must match no matter
what steps are taken. Read moreSource§fn accept_eof(&self, _: &Self::State) -> Option<Self::State>
fn accept_eof(&self, _: &Self::State) -> Option<Self::State>
If applicable, return the next state when the end of a key is seen.
Source§fn starts_with(self) -> StartsWith<Self>where
Self: Sized,
fn starts_with(self) -> StartsWith<Self>where
Self: Sized,
Returns an automaton that matches the strings that start with something
this automaton matches.
Source§fn union<Rhs>(self, rhs: Rhs) -> Union<Self, Rhs>
fn union<Rhs>(self, rhs: Rhs) -> Union<Self, Rhs>
Returns an automaton that matches the strings matched by either this or
the other automaton.
Source§fn intersection<Rhs>(self, rhs: Rhs) -> Intersection<Self, Rhs>
fn intersection<Rhs>(self, rhs: Rhs) -> Intersection<Self, Rhs>
Returns an automaton that matches the strings matched by both this and
the other automaton.
Source§fn complement(self) -> Complement<Self>where
Self: Sized,
fn complement(self) -> Complement<Self>where
Self: Sized,
Returns an automaton that matches the strings not matched by this
automaton.
Auto Trait Implementations§
impl Freeze for Wordle
impl RefUnwindSafe for Wordle
impl Send for Wordle
impl Sync for Wordle
impl Unpin for Wordle
impl UnwindSafe for Wordle
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