pub struct ChessMove { /* private fields */ }
Expand description
Represent a ChessMove in memory
Implementations
sourceimpl ChessMove
impl ChessMove
sourcepub fn new(source: Square, dest: Square, promotion: Option<Piece>) -> ChessMove
pub fn new(source: Square, dest: Square, promotion: Option<Piece>) -> ChessMove
Create a new chess move, given a source Square
, a destination Square
, and an optional
promotion Piece
sourcepub fn get_source(&self) -> Square
pub fn get_source(&self) -> Square
Get the source square (square the piece is currently on).
sourcepub fn get_promotion(&self) -> Option<Piece>
pub fn get_promotion(&self) -> Option<Piece>
Get the promotion piece (maybe).
Trait Implementations
sourceimpl Ord for ChessMove
impl Ord for ChessMove
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<ChessMove> for ChessMove
impl PartialOrd<ChessMove> for ChessMove
sourcefn partial_cmp(&self, other: &ChessMove) -> Option<Ordering>
fn partial_cmp(&self, other: &ChessMove) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ChessMove
impl Eq for ChessMove
impl StructuralEq for ChessMove
impl StructuralPartialEq for ChessMove
Auto Trait Implementations
impl RefUnwindSafe for ChessMove
impl Send for ChessMove
impl Sync for ChessMove
impl Unpin for ChessMove
impl UnwindSafe for ChessMove
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more