#[non_exhaustive]pub enum BoardError {
PlayedCardInHand,
InconsistentHandSizes,
Revoke {
position: RevokePosition,
},
}Expand description
Error returned when constructing a Board with invalid invariants
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.
PlayedCardInHand
A card on the table is still present in one of the remaining hands
InconsistentHandSizes
The remaining hand sizes do not match the number of played cards
With k cards on the table, exactly the k seats starting from
leader (in playing order) must have one fewer card than the other
seats; all other seats must share a common size.
Revoke
A played card does not follow suit though the player held the led suit
Fields
§
position: RevokePositionPosition of the revoking card within the current trick
Trait Implementations§
Source§impl Clone for BoardError
impl Clone for BoardError
Source§fn clone(&self) -> BoardError
fn clone(&self) -> BoardError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BoardError
impl Debug for BoardError
Source§impl Display for BoardError
impl Display for BoardError
Source§impl Error for BoardError
impl Error for BoardError
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 BoardError
impl Hash for BoardError
Source§impl PartialEq for BoardError
impl PartialEq for BoardError
impl Copy for BoardError
impl Eq for BoardError
impl StructuralPartialEq for BoardError
Auto Trait Implementations§
impl Freeze for BoardError
impl RefUnwindSafe for BoardError
impl Send for BoardError
impl Sync for BoardError
impl Unpin for BoardError
impl UnsafeUnpin for BoardError
impl UnwindSafe for BoardError
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