pub enum Color {
White,
Black,
}
Expand description
Represent a color.
Variants
White
Black
Implementations
sourceimpl Color
impl Color
sourcepub fn to_my_backrank(&self) -> Rank
pub fn to_my_backrank(&self) -> Rank
Covert the Color
to a rank, which reperesnts the starting position
for that colors 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 position 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 position for my pawns.
pub fn to_fourth_rank(&self) -> Rank
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
sourceimpl PartialOrd<Color> for Color
impl PartialOrd<Color> for Color
sourcefn partial_cmp(&self, other: &Color) -> Option<Ordering>
fn partial_cmp(&self, other: &Color) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more