pub enum Move {
Normal {
role: Role,
from: Square,
capture: Option<Role>,
to: Square,
promotion: Option<Role>,
},
EnPassant {
from: Square,
to: Square,
},
Castle {
king: Square,
rook: Square,
},
Put {
role: Role,
to: Square,
},
}
Expand description
Information about a move.
Variants
Normal
EnPassant
Castle
Put
Implementations
sourceimpl Move
impl Move
sourcepub fn to(&self) -> Square
pub fn to(&self) -> Square
Gets the target square. For castling moves this is the corresponding rook square.
sourcepub fn is_capture(&self) -> bool
pub fn is_capture(&self) -> bool
Checks if the move is a capture.
sourcepub fn is_en_passant(&self) -> bool
pub fn is_en_passant(&self) -> bool
Checks if the move is en passant.
sourcepub fn is_zeroing(&self) -> bool
pub fn is_zeroing(&self) -> bool
Checks if the move zeros the half-move clock.
sourcepub fn castling_side(&self) -> Option<CastlingSide>
pub fn castling_side(&self) -> Option<CastlingSide>
Gets the castling side.
sourcepub fn is_promotion(&self) -> bool
pub fn is_promotion(&self) -> bool
Checks if the move is a promotion.
Trait Implementations
impl Eq for Move
impl StructuralEq for Move
impl StructuralPartialEq for Move
Auto Trait Implementations
impl RefUnwindSafe for Move
impl Send for Move
impl Sync for Move
impl Unpin for Move
impl UnwindSafe for Move
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