pub enum Error {
Show 14 variants
GameStarted,
GameEnded,
CubeReceived,
CubeNotPermitted,
CubeValueInvalid,
PlayerInvalid,
FieldBlocked,
FieldInvalid,
NotYourTurn,
MoveInvalid,
MoveInvalidBar,
MoveFirst,
RollFirst,
DiceInvalid,
}Expand description
Holds all possible errors that can occur during a Backgammon game.
Variants§
GameStarted
Game has already started
GameEnded
Game has already ended
CubeReceived
Opponent offered doubling cube. Need to react to this event first.
CubeNotPermitted
Doubling is not permitted
CubeValueInvalid
Invalid cube value
PlayerInvalid
Invalid player
FieldBlocked
Field blocked
FieldInvalid
Invalid field
NotYourTurn
Not your turn
MoveInvalid
Invalid move
MoveInvalidBar
Invalid move, checker on bar
MoveFirst
Move first
RollFirst
Roll first
DiceInvalid
Dice Invalid
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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