#[repr(packed(2))]pub struct Move { /* private fields */ }Expand description
Represents a move on the chess position. Uses a compact 16 bit representation
Implementations§
Source§impl Move
impl Move
pub fn from(self) -> Square
pub fn to(self) -> Square
pub fn promote_to(self) -> Kind
Sourcepub fn distance(self) -> i32
pub fn distance(self) -> i32
Returns the absolute distance moved. Eg for a push from square 8 to square 24: |24 - 8| = 16
pub fn is_castle(self) -> bool
pub fn is_capture(self) -> bool
pub fn is_ep_capture(self) -> bool
pub fn is_promotion(self) -> bool
pub fn castle(self) -> Castle
pub fn new_move(from: Square, to: Square, is_capture: bool) -> Move
pub fn new_push(from: Square, to: Square) -> Move
pub fn new_capture(from: Square, to: Square) -> Move
pub fn new_castle(castle: Castle) -> Move
pub fn new_promotion(from: Square, to: Square, promote_to: Kind) -> Move
pub fn new_capture_promotion(from: Square, to: Square, promote_to: Kind) -> Move
pub fn new_ep_capture(from: Square, to: Square) -> Move
Trait Implementations§
impl Copy for Move
impl Eq for Move
impl StructuralPartialEq for Move
Auto Trait Implementations§
impl Freeze for Move
impl RefUnwindSafe for Move
impl Send for Move
impl Sync for Move
impl Unpin for Move
impl UnwindSafe for Move
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