Trait chess_notation_parser::FlagCheck 
source · [−]pub trait FlagCheck {
    fn get_flags(&self) -> u8;
    fn check_flag(&self, flag: u8) -> bool { ... }
}Expand description
Implements function to easily check chess turn flags
Required Methods
Provided Methods
fn check_flag(&self, flag: u8) -> bool
fn check_flag(&self, flag: u8) -> bool
Returns true if flag is present
Example
use chess_notation_parser::{Turn, Move, Square, Piece, Flag, FlagCheck};
let r#move = Move {
    who: Piece::King,
    dst: Square::D5,
    flags: Flag::CAPTURE,
    src: None,
    promotion: None
};
assert!(r#move.check_flag(Flag::CAPTURE));
assert!(!r#move.check_flag(Flag::CHECK));