Enum shogi::color::Color [−][src]
pub enum Color {
Black,
White,
}
Expand description
Represents each side of player. Black player moves first.
Examples
use shogi::Color;
let c = Color::Black;
match c {
Color::Black => assert!(true),
Color::White => unreachable!(),
}
Variants
Implementations
Returns an iterator of all variants.
Returns the color of the opposite side.
Examples
use shogi::Color;
assert_eq!(Color::White, Color::Black.flip());
assert_eq!(Color::Black, Color::White.flip());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Color
impl UnwindSafe for Color
Blanket Implementations
Mutably borrows from an owned value. Read more