Skip to main content

chess/
lib.rs

1#![doc(html_root_url = "https://jordanbray.github.io/chess/")]
2//! # Rust Chess Library
3//! This is a chess move generation library for rust.  It is designed to be fast, so that it can be
4//! used in a chess engine or UI without performance issues.
5//!
6//! ## Example
7//!
8//! This generates all the moves on the starting chess position, and checks that the number of
9//! moves is correct.
10//!
11//! ```
12//!
13//! use chess::{Board, MoveGen};
14//!
15//! let board = Board::default();
16//! let movegen = MoveGen::new_legal(&board);
17//! assert_eq!(movegen.len(), 20);
18//! ```
19//!
20
21mod board;
22pub use crate::board::*;
23
24mod bitboard;
25pub use crate::bitboard::{BitBoard, EMPTY};
26
27mod cache_table;
28pub use crate::cache_table::*;
29
30mod castle_rights;
31pub use crate::castle_rights::*;
32
33mod chess_move;
34pub use crate::chess_move::*;
35
36mod color;
37pub use crate::color::*;
38
39mod construct;
40pub use crate::construct::*;
41
42mod file;
43pub use crate::file::*;
44
45mod magic;
46pub use crate::magic::{
47	EDGES, between, get_adjacent_files, get_bishop_moves, get_bishop_rays, get_file, get_king_moves, get_knight_moves, get_pawn_attacks, get_pawn_moves,
48	get_pawn_quiets, get_rank, get_rook_moves, get_rook_rays, line,
49};
50
51#[cfg(target_feature = "bmi2")]
52pub use crate::magic::{get_bishop_moves_bmi, get_rook_moves_bmi};
53
54mod piece;
55pub use crate::piece::*;
56
57mod rank;
58pub use crate::rank::*;
59
60mod square;
61pub use crate::square::*;
62
63mod movegen;
64pub use crate::movegen::MoveGen;
65
66mod zobrist;
67
68mod game;
69pub use crate::game::{Action, Game, GameResult};
70
71mod board_builder;
72pub use crate::board_builder::BoardBuilder;
73
74mod error;
75pub use crate::error::Error;