#[non_exhaustive]pub enum RoundError {
WrongPhase(Phase),
MustDrawFromStock,
NotInHand(Card),
DiscardJustTaken(Card),
TooMuchDeadwood {
deadwood: u8,
limit: u8,
},
MeldsMismatch,
NotBigGin,
BigGinDisabled,
NoSuchMeld(usize),
CannotLayOff(Card),
}Expand description
Error returned when a Round action is illegal
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.
WrongPhase(Phase)
The action does not belong to the current phase
MustDrawFromStock
After both players pass the upcard, the first draw must come from the stock
NotInHand(Card)
The card is not in the acting player’s hand
DiscardJustTaken(Card)
The card was taken from the discard pile this turn
TooMuchDeadwood
The arrangement’s deadwood exceeds the knock limit
MeldsMismatch
The melds do not arrange the knocker’s remaining hand
NotBigGin
The hand is not fully melded
BigGinDisabled
Big gin is disabled by the rules
NoSuchMeld(usize)
No meld at this index in the spread
CannotLayOff(Card)
The card extends no end of the meld
Trait Implementations§
Source§impl Clone for RoundError
impl Clone for RoundError
Source§fn clone(&self) -> RoundError
fn clone(&self) -> RoundError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RoundError
Source§impl Debug for RoundError
impl Debug for RoundError
Source§impl Display for RoundError
impl Display for RoundError
impl Eq for RoundError
Source§impl Error for RoundError
impl Error for RoundError
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()
Source§impl Hash for RoundError
impl Hash for RoundError
Source§impl PartialEq for RoundError
impl PartialEq for RoundError
impl StructuralPartialEq for RoundError
Auto Trait Implementations§
impl Freeze for RoundError
impl RefUnwindSafe for RoundError
impl Send for RoundError
impl Sync for RoundError
impl Unpin for RoundError
impl UnsafeUnpin for RoundError
impl UnwindSafe for RoundError
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