pub struct Castling {
pub type: CastlingType,
pub flags: u8,
}
Expand description
§Castling turn
In chess, castling is a special move where a King can move two squares either to the left (Kingside Castle) or right (Queenside Castle). The rook is then placed to the left or right of the King respectively.
§Example
use chess_notation_parser::{Turn, Castling, CastlingType, Flag};
let turn = Turn::Castling(
Castling {
r#type: CastlingType::Short,
flags: Flag::CHECK,
}
);
assert_eq!(turn, Turn::try_from("0-0+").unwrap());
Fields§
§type: CastlingType
Castling type (side)
flags: u8
Extra bits of information stored in a bitmask about the turn, check
Flag
for more info
Trait Implementations§
impl Copy for Castling
impl StructuralPartialEq for Castling
Auto Trait Implementations§
impl Freeze for Castling
impl RefUnwindSafe for Castling
impl Send for Castling
impl Sync for Castling
impl Unpin for Castling
impl UnwindSafe for Castling
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