#[non_exhaustive]pub enum GameError {
RollPending,
ActionPending,
KeptNotHeld {
kept: Keep,
},
KeepNotInDice {
keep: Keep,
},
NoRerollsLeft,
IllegalCategory {
category: Category,
},
Finished,
}Expand description
A rules violation, reported without changing the game.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
RollPending
Game::act was called while dice were due.
ActionPending
Game::roll was called while a decision was due.
KeptNotHeld
The injected roll does not contain the dice held from last roll.
KeepNotInDice
The kept dice are not a subset of the dice on the table.
NoRerollsLeft
A reroll was requested after the third roll.
IllegalCategory
The category is filled, or the joker rule forces another.
Finished
The game is over.
Trait Implementations§
impl Copy for GameError
impl Eq for GameError
Source§impl Error for GameError
impl Error for GameError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
impl StructuralPartialEq for GameError
Auto Trait Implementations§
impl Freeze for GameError
impl RefUnwindSafe for GameError
impl Send for GameError
impl Sync for GameError
impl Unpin for GameError
impl UnsafeUnpin for GameError
impl UnwindSafe for GameError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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