#[repr(align(4))]
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.
sourceimpl Move
impl Move
sourcepub fn to_uci(&self, mode: CastlingMode) -> Uci
pub fn to_uci(&self, mode: CastlingMode) -> Uci
See Uci::from_move()
.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more