Enum hexe_core::piece::Promotion
[−]
[src]
#[repr(u8)]pub enum Promotion { Knight, Bishop, Rook, Queen, }
A promotion piece role.
Variants
Knight
Bishop
Rook
Queen
Methods
impl Promotion
[src]
pub fn from_role(role: Role) -> Option<Promotion>
[src]
Returns a promotion for the piece role, if possible.
pub fn into_str(self) -> &'static str
[src]
Converts self
into a static string.
Trait Implementations
impl<T> Extract<[T; 4]> for Promotion
[src]
type Output = T
The output type.
fn extract<'a>(self, buf: &'a [T; 4]) -> &'a T
[src]
Extracts a reference to the value for self
within buf
.
fn extract_mut<'a>(self, buf: &'a mut [T; 4]) -> &'a mut T
[src]
Extracts a mutable reference to the value for self
within buf
.
impl From<Promotion> for Role
[src]
impl Copy for Promotion
[src]
impl Clone for Promotion
[src]
fn clone(&self) -> Promotion
[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 Promotion
[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 Promotion
[src]
fn eq(&self, __arg_0: &Promotion) -> 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 Promotion
[src]
impl FromUnchecked<u8> for Promotion
[src]
unsafe fn from_unchecked(inner: u8) -> Self
[src]
Performs the unchecked conversion.
impl From<u8> for Promotion
[src]
impl FromUnchecked<u16> for Promotion
[src]
unsafe fn from_unchecked(inner: u16) -> Self
[src]
Performs the unchecked conversion.
impl From<u16> for Promotion
[src]
impl FromUnchecked<u32> for Promotion
[src]
unsafe fn from_unchecked(inner: u32) -> Self
[src]
Performs the unchecked conversion.
impl From<u32> for Promotion
[src]
impl FromUnchecked<u64> for Promotion
[src]
unsafe fn from_unchecked(inner: u64) -> Self
[src]
Performs the unchecked conversion.
impl From<u64> for Promotion
[src]
impl FromUnchecked<usize> for Promotion
[src]
unsafe fn from_unchecked(inner: usize) -> Self
[src]
Performs the unchecked conversion.
impl From<usize> for Promotion
[src]
impl Debug for Promotion
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for Promotion
[src]
impl FromUnchecked<Role> for Promotion
[src]
unsafe fn from_unchecked(role: Role) -> Promotion
[src]
Performs the unchecked conversion.