vampirc-uci

Vampirc UCI is a Universal Chess Interface (UCI) protocol parser and serializer.
The UCI protocol is a way for a chess engine to communicate with a chessboard GUI, such as Cute Chess.
The Vampirc Project is a chess engine and chess library suite, written in Rust. It is named for the Slovenian grandmaster Vasja Pirc, and, I guess, vampires? I dunno.
Vampirc UCI uses the PEST parser to parse the UCI messages. If you want to build your own abstractions of the protocol, the corresponding PEG grammar is available here.
Installing the library
To use the crate, declare a dependency on it in your Cargo.toml file:
[]
= "0.6"
Usage
- Import either the
parse(..)method or theparse_strict(..)method. The difference between them that is thatparse_strict(..)will return anpest::error::Errorif any of the input is unrecognized or violates the rules of the PEG grammar, whereasparsesimply ignores it. The latter is the approach recommended by the protocol specification.
use parse;
- Some other useful imports (for message representation):
use ;
- Parse some input:
let messages: MessageList = parse;
- Do something with the parsed messages:
for m in messages
- Outputting the messages
let message = Option;
println!; // Outputs "option name Selectivity type spin default 2 min 0 max 4"
API
The full API documentation is available at docs.rs.
Limitations
The current version 0.6.x only supports the parsing of engine–bound messages. These include:
ucidebugisreadyregisterpositionsetoptionucinewgamestopponderhitquitgo
Support for the rest is coming up.
Since 0.6.0, it does, however, support representation and serialization of all the GUI-bound messages:
iduciokreadyokbestmovecopyprotectionregistrationoption