#[repr(u8)]pub enum Color {
White = 0,
Black = 1,
}Expand description
Color of chess pieces (either white or black)
Variants§
Implementations§
Source§impl Color
impl Color
Sourcepub fn as_char(&self) -> char
pub fn as_char(&self) -> char
Returns a character representation of the color
The character representation is "w" for white, and "b" for black.
Sourcepub fn from_char(c: char) -> Option<Color>
pub fn from_char(c: char) -> Option<Color>
Creates a color from its character representation
If c is not a valid character representation of color, returns None.
Sourcepub fn as_long_str(&self) -> &'static str
pub fn as_long_str(&self) -> &'static str
Returns a full string representation of the color (either "white" or "black")
Trait Implementations§
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
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