#[repr(u8)]pub enum Role {
Pawn = 1,
Knight = 2,
Bishop = 3,
Rook = 5,
Queen = 9,
King = 4,
}Expand description
A chess piece role, such as pawn, knight, bishop, etc.
Variants§
Implementations§
Source§impl Role
Role Finite Set API.
impl Role
Role Finite Set API.
pub const LEN: usize
pub const ALL: [Self; 6]
pub const fn name(self) -> &'static str
pub const fn eq(self, other: Self) -> bool
pub const fn index(self) -> usize
pub const fn from_index(index: u8) -> Option<Self>
pub fn iter() -> impl Iterator<Item = Self>
pub fn iter_rev() -> impl Iterator<Item = Self>
Trait Implementations§
impl Copy for Role
impl Eq for Role
Source§impl Ord for Role
impl Ord for Role
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Role
impl PartialOrd for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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