vampirc_uci/
lib.rs

1//! The Vampirc project is a chess engine written in Rust. `vampirc-uci` is a crate that handles the parsing of the
2//! [Universal Chess Interface (UCI) protocol](https://en.wikipedia.org/wiki/Universal_Chess_Interface), a way for a
3//! chess engine to communicate with a GUI.
4//!
5//! To parse the UCI messages, it uses the [PEST parser](https://github.com/pest-parser/pest). The corresponding PEG
6//! grammar is available [here](https://github.com/vampirc/vampirc-uci/blob/master/res/uci.pest).
7//!
8//! See the [README.md](https://github.com/vampirc/vampirc-uci/blob/master/README.md) file for usage instructions.
9
10
11#[cfg(feature = "chess")]
12extern crate chess;
13extern crate chrono;
14extern crate pest;
15#[macro_use]
16extern crate pest_derive;
17
18#[cfg(feature = "chess")]
19pub use chess::ChessMove;
20#[cfg(feature = "chess")]
21pub use chess::Piece;
22#[cfg(feature = "chess")]
23pub use chess::Square;
24pub use chrono::Duration;
25pub use pest::error::Error;
26
27pub use self::parser::parse;
28pub use self::parser::parse_one;
29pub use self::parser::parse_strict;
30pub use self::parser::parse_with_unknown;
31pub use self::parser::Rule;
32pub use self::uci::ByteVecUciMessage;
33pub use self::uci::CommunicationDirection;
34pub use self::uci::MessageList;
35pub use self::uci::ProtectionState;
36pub use self::uci::Serializable;
37pub use self::uci::UciFen;
38pub use self::uci::UciInfoAttribute;
39pub use self::uci::UciMessage;
40#[cfg(not(feature = "chess"))]
41pub use self::uci::UciMove;
42pub use self::uci::UciOptionConfig;
43#[cfg(not(feature = "chess"))]
44pub use self::uci::UciPiece;
45pub use self::uci::UciSearchControl;
46#[cfg(not(feature = "chess"))]
47pub use self::uci::UciSquare;
48pub use self::uci::UciTimeControl;
49
50pub mod uci;
51pub mod parser;
52
53#[cfg(test)]
54mod tests {
55    #[test]
56    fn it_works() {
57        assert_eq!(2 + 2, 4);
58    }
59}