Enum bulls_and_cows::HostError
source · pub enum HostError<T: Eq + Hash + Clone> {
LettersEmpty,
AnswerLengthIncorrect,
AnswerContainsIncorrectLetter(T),
AnswerContainsDuplicatedLetter(T),
}
Expand description
The possible errors for the Host
struct.
Variants§
LettersEmpty
The length of letters for a Bulls and Cows game must be at least 1.
AnswerLengthIncorrect
The length of the answer is incorrect.
AnswerContainsIncorrectLetter(T)
There is an incorrect letter in the answer.
AnswerContainsDuplicatedLetter(T)
There is an duplicated letter in the answer.
Trait Implementations§
source§impl<T: Eq + Hash + Clone> Error for HostError<T>
impl<T: Eq + Hash + Clone> Error for HostError<T>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T: PartialEq + Eq + Hash + Clone> PartialEq for HostError<T>
impl<T: PartialEq + Eq + Hash + Clone> PartialEq for HostError<T>
impl<T: Eq + Eq + Hash + Clone> Eq for HostError<T>
impl<T: Eq + Hash + Clone> StructuralPartialEq for HostError<T>
Auto Trait Implementations§
impl<T> Freeze for HostError<T>where
T: Freeze,
impl<T> RefUnwindSafe for HostError<T>where
T: RefUnwindSafe,
impl<T> Send for HostError<T>where
T: Send,
impl<T> Sync for HostError<T>where
T: Sync,
impl<T> Unpin for HostError<T>where
T: Unpin,
impl<T> UnwindSafe for HostError<T>where
T: UnwindSafe,
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