Enum hexe_core::piece::Role
[−]
[src]
#[repr(u8)]pub enum Role { Pawn, Knight, Bishop, Rook, Queen, King, }
A chess piece role.
Variants
Pawn
Knight
Bishop
Rook
Queen
King
Methods
impl Role
[src]
pub fn from_char(ch: char) -> Option<Role>
[src]
Returns a piece role from the parsed character.
pub fn into_str(self) -> &'static str
[src]
Converts self
into a static string.
pub fn into_char(self) -> char
[src]
Converts self
into a character.
pub fn is_slider(self) -> bool
[src]
Returns whether self
is a piece role that can slide across the board.
pub fn is_promotion(&self) -> bool
[src]
The role is a promotion.
Trait Implementations
impl Index<Role> for MultiBoard
[src]
type Output = Bitboard
The returned type after indexing.
ⓘImportant traits for Bitboardfn index(&self, role: Role) -> &Bitboard
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<Role> for MultiBoard
[src]
ⓘImportant traits for Bitboardfn index_mut(&mut self, role: Role) -> &mut Bitboard
[src]
Performs the mutable indexing (container[index]
) operation.
impl Index for Role
[src]
ⓘImportant traits for Bitboardfn bitboard(self, board: &MultiBoard) -> Bitboard
[src]
Returns the bitboard for self
in board
.
fn remove<T: Into<Bitboard>>(self, bits: T, board: &mut MultiBoard)
[src]
Removes the bits
of self
from board
.
fn remove_unchecked<T: Into<Bitboard>>(self, bits: T, board: &mut MultiBoard)
[src]
Performs a blind removal of self
at bits
in board
.
impl From<Side> for Role
[src]
impl<T> Extract<[T; 6]> for Role
[src]
type Output = T
The output type.
fn extract<'a>(self, buf: &'a [T; 6]) -> &'a T
[src]
Extracts a reference to the value for self
within buf
.
fn extract_mut<'a>(self, buf: &'a mut [T; 6]) -> &'a mut T
[src]
Extracts a mutable reference to the value for self
within buf
.
impl Copy for Role
[src]
impl Clone for Role
[src]
fn clone(&self) -> Role
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Hash for Role
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Role
[src]
fn eq(&self, __arg_0: &Role) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Role
[src]
impl FromUnchecked<u8> for Role
[src]
unsafe fn from_unchecked(inner: u8) -> Self
[src]
Performs the unchecked conversion.
impl From<u8> for Role
[src]
impl FromUnchecked<u16> for Role
[src]
unsafe fn from_unchecked(inner: u16) -> Self
[src]
Performs the unchecked conversion.
impl From<u16> for Role
[src]
impl FromUnchecked<u32> for Role
[src]
unsafe fn from_unchecked(inner: u32) -> Self
[src]
Performs the unchecked conversion.
impl From<u32> for Role
[src]
impl FromUnchecked<u64> for Role
[src]
unsafe fn from_unchecked(inner: u64) -> Self
[src]
Performs the unchecked conversion.
impl From<u64> for Role
[src]
impl FromUnchecked<usize> for Role
[src]
unsafe fn from_unchecked(inner: usize) -> Self
[src]
Performs the unchecked conversion.
impl From<usize> for Role
[src]
impl Debug for Role
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Role
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl From<Role> for char
[src]
impl From<Promotion> for Role
[src]
impl FromStr for Role
[src]
type Err = FromStrError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Role, FromStrError>
[src]
Parses a string s
to return a value of this type. Read more
impl FromUnchecked<Role> for Promotion
[src]
unsafe fn from_unchecked(role: Role) -> Promotion
[src]
Performs the unchecked conversion.