Enum hexe_core::castle::Right
[−]
[src]
#[repr(u8)]pub enum Right { WhiteKing, WhiteQueen, BlackKing, BlackQueen, }
An individual castle right for a chess game.
Variants
WhiteKing
White kingside: E1 to G1.
WhiteQueen
White queenside: E1 to C1.
BlackKing
Black kingside: E8 to G8.
BlackQueen
Black queenside: E8 to C8.
Methods
impl Right
[src]
pub fn new(color: Color, side: Side) -> Right
[src]
Creates a new castle right for color
and side
.
pub fn from_char(ch: char) -> Option<Right>
[src]
Returns a castle right from the parsed character.
ⓘImportant traits for Bitboardpub fn path(self) -> Bitboard
[src]
Returns the path between the rook and king for this right.
ⓘImportant traits for Range<T>pub fn path_iter(self) -> Range<Square>
[src]
Returns an efficient iterator over each square in the path between the
rook and king for self
.
pub fn color(self) -> Color
[src]
Returns the color for self
.
pub fn side(self) -> Side
[src]
Returns the castle side for self
.
Trait Implementations
impl<T: Into<Rights>> BitOr<T> for Right
[src]
type Output = Rights
The resulting type after applying the |
operator.
ⓘImportant traits for Rightsfn bitor(self, other: T) -> Rights
[src]
Performs the |
operation.
impl<T: Into<Rights>> BitAnd<T> for Right
[src]
type Output = Rights
The resulting type after applying the &
operator.
ⓘImportant traits for Rightsfn bitand(self, other: T) -> Rights
[src]
Performs the &
operation.
impl<T: Into<Rights>> BitXor<T> for Right
[src]
type Output = Rights
The resulting type after applying the ^
operator.
ⓘImportant traits for Rightsfn bitxor(self, other: T) -> Rights
[src]
Performs the ^
operation.
impl From<Right> for Rights
[src]
impl PartialEq for Right
[src]
fn eq(&self, __arg_0: &Right) -> 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 Right
[src]
impl Clone for Right
[src]
fn clone(&self) -> Right
[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 Copy for Right
[src]
impl Debug for Right
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Hash for Right
[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 FromUnchecked<u8> for Right
[src]
unsafe fn from_unchecked(inner: u8) -> Self
[src]
Performs the unchecked conversion.
impl From<u8> for Right
[src]
impl FromUnchecked<u16> for Right
[src]
unsafe fn from_unchecked(inner: u16) -> Self
[src]
Performs the unchecked conversion.
impl From<u16> for Right
[src]
impl FromUnchecked<u32> for Right
[src]
unsafe fn from_unchecked(inner: u32) -> Self
[src]
Performs the unchecked conversion.
impl From<u32> for Right
[src]
impl FromUnchecked<u64> for Right
[src]
unsafe fn from_unchecked(inner: u64) -> Self
[src]
Performs the unchecked conversion.
impl From<u64> for Right
[src]
impl FromUnchecked<usize> for Right
[src]
unsafe fn from_unchecked(inner: usize) -> Self
[src]
Performs the unchecked conversion.
impl From<usize> for Right
[src]
impl From<Right> for char
[src]
impl From<Right> for Piece
[src]
impl<T> Extract<[T; 4]> for Right
[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
.