#[repr(u8)]pub enum Side {
King = 0,
Queen = 1,
}Expand description
A side of the board to castle toward.
Variants§
Implementations§
Source§impl Side
Side Finite Set API.
impl Side
Side Finite Set API.
pub const LEN: usize
pub const ALL: [Self; 2]
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>
Source§impl Side
impl Side
pub const fn chess_rook(self) -> File
pub const fn of_rook(king: Square, rook: File) -> Self
Sourcepub const fn king_to_file(self) -> File
pub const fn king_to_file(self) -> File
The file the king moves to when castling on this side
Sourcepub const fn rook_to_file(self) -> File
pub const fn rook_to_file(self) -> File
The file the rook moves to when castling on this side.
Trait Implementations§
impl Copy for Side
impl Eq for Side
Source§impl Ord for Side
impl Ord for Side
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 Side
impl PartialOrd for Side
impl StructuralPartialEq for Side
Auto Trait Implementations§
impl Freeze for Side
impl RefUnwindSafe for Side
impl Send for Side
impl Sync for Side
impl Unpin for Side
impl UnsafeUnpin for Side
impl UnwindSafe for Side
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