pub enum Color {
White,
Black,
}Expand description
Represent a color.
Variants§
Implementations§
Source§impl Color
impl Color
Sourcepub fn to_my_backrank(&self) -> Rank
pub fn to_my_backrank(&self) -> Rank
Convert a Color to my backrank, which represents the starting rank
for my pieces.
Sourcepub fn to_their_backrank(&self) -> Rank
pub fn to_their_backrank(&self) -> Rank
Convert a Color to my opponents backrank, which represents the starting rank for the
opponents pieces.
Sourcepub fn to_second_rank(&self) -> Rank
pub fn to_second_rank(&self) -> Rank
Convert a Color to my second rank, which represents the starting rank for my pawns.
Sourcepub fn to_fourth_rank(&self) -> Rank
pub fn to_fourth_rank(&self) -> Rank
Convert a Color to my fourth rank, which represents the rank of my pawns when
moving two squares forward.
Sourcepub fn to_seventh_rank(&self) -> Rank
pub fn to_seventh_rank(&self) -> Rank
Convert a Color to my seventh rank, which represents the rank before pawn promotion.
Trait Implementations§
Source§impl PartialOrd for Color
impl PartialOrd for Color
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 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