Crate shakmaty_uci

Source
Expand description

A library to parse and write Universal Chess Interface (UCI) message.

§Examples

Ask the engine to evaluate a position:

use shakmaty_uci::UciMessage;

println!("{}", UciMessage::Uci); // uci
assert_eq!("uciok".parse(), Ok(UciMessage::UciOk));
println!(
    "{}",
    UciMessage::Position{
        startpos: true,
        fen: None,
        moves: vec![
            "e2e4".parse().unwrap(),
            "e7e5".parse().unwrap(),
            "g8f3".parse().unwrap(),
        ],
    }
);
println!("{}", UciMessage::go_infinite())

Re-exports§

pub use shakmaty::uci::IllegalUciMoveError;
pub use shakmaty::uci::ParseUciMoveError;
pub use shakmaty::uci::UciMove;

Structs§

ParseUciMessageError
Error when parsing an invalid UCI message.
UciInfo
UciInfoCurrLine
UciInfoScore
UciSearchControl
A struct that controls the engine’s (non-time-related) search settings.

Enums§

ProtectionState
Represents the copy protection or registration state.
UciMessage
A representation of a message going to and coming from an UCI engine.
UciOptionConfig
Represents a UCI option definition.
UciTimeControl
This enum represents the possible variants of the go UCI message that deal with the chess game’s time controls and the engine’s thinking time.