#[repr(u8)]pub enum GameResolution {
BlackWins = 1,
WhiteWins = 2,
Draw = 3,
Rematch = 4,
Aborted = 5,
}
Expand description
How a game is resolved.
GameResolution
and Option<GameResolution>
are both 1-byte data types.
Because they are cheap to copy, they implement Copy
.
Variants§
BlackWins = 1
White’s king was mated or white resigned.
Discriminant = 1.
WhiteWins = 2
Black’s king was mated or black resigned.
Discriminant = 2.
Draw = 3
This can happen if e.g. 持将棋
(jishōgi) happens.
Discriminant = 3.
Rematch = 4
This can happen if e.g. 千日手
(sennichite, repetition) happens.
Discriminant = 4.
Aborted = 5
The game was aborted.
Discriminant = 5.
Implementations§
Source§impl GameResolution
impl GameResolution
Source#[export_name = "GameResolution_from_u8_unchecked"]pub unsafe extern "C" fn from_u8_unchecked(repr: u8) -> Self
#[export_name = "GameResolution_from_u8_unchecked"]pub unsafe extern "C" fn from_u8_unchecked(repr: u8) -> Self
Converts a u8
to GameResolution
without checking.
§Safety
repr
must be a valid representation of GameResolution
.
This condition is equivalent to 1 <= repr && repr <= 5
.
Trait Implementations§
Source§impl Clone for GameResolution
impl Clone for GameResolution
Source§fn clone(&self) -> GameResolution
fn clone(&self) -> GameResolution
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 GameResolution
impl Debug for GameResolution
Source§impl Hash for GameResolution
Available on crate feature hash
only.
impl Hash for GameResolution
Available on crate feature
hash
only.Source§impl Ord for GameResolution
Available on crate feature ord
only.
impl Ord for GameResolution
Available on crate feature
ord
only.Source§impl PartialEq for GameResolution
impl PartialEq for GameResolution
Source§impl PartialOrd for GameResolution
Available on crate feature ord
only.
impl PartialOrd for GameResolution
Available on crate feature
ord
only.impl Copy for GameResolution
impl Eq for GameResolution
impl StructuralPartialEq for GameResolution
Auto Trait Implementations§
impl Freeze for GameResolution
impl RefUnwindSafe for GameResolution
impl Send for GameResolution
impl Sync for GameResolution
impl Unpin for GameResolution
impl UnwindSafe for GameResolution
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