pub enum File {
A,
B,
C,
D,
E,
F,
G,
H,
}Expand description
A file on a chessboard.
Variants§
A
The A file.
B
The B file.
C
The C file.
D
The D file.
E
The E file.
F
The F file.
G
The G file.
H
The H file.
Implementations§
Source§impl File
impl File
Source§impl File
impl File
Sourcepub const fn bitboard(self) -> BitBoard
pub const fn bitboard(self) -> BitBoard
Get a bitboard with all squares on this file set.
§Examples
assert_eq!(File::B.bitboard(), bitboard! {
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
});Sourcepub const fn adjacent(self) -> BitBoard
pub const fn adjacent(self) -> BitBoard
Get a bitboard with all squares on adjacent files set.
§Examples
assert_eq!(File::C.adjacent(), bitboard! {
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
});
assert_eq!(File::A.adjacent(), bitboard! {
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
});
assert_eq!(File::H.adjacent(), bitboard! {
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
});Trait Implementations§
Source§impl Ord for File
impl Ord for File
Source§impl PartialOrd for File
impl PartialOrd for File
impl Copy for File
impl Eq for File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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