pub enum UciMessage {
Show 20 variants
Uci,
Debug(bool),
IsReady,
Register {
later: bool,
name: Option<String>,
code: Option<String>,
},
Position {
startpos: bool,
fen: Option<UciFen>,
moves: Vec<UciMove>,
},
SetOption {
name: String,
value: Option<String>,
},
UciNewGame,
Stop,
PonderHit,
Quit,
Go {
time_control: Option<UciTimeControl>,
search_control: Option<UciSearchControl>,
},
Id {
name: Option<String>,
author: Option<String>,
},
UciOk,
ReadyOk,
BestMove {
best_move: UciMove,
ponder: Option<UciMove>,
},
CopyProtection(ProtectionState),
Registration(ProtectionState),
Option(UciOptionConfig),
Info(Vec<UciInfoAttribute>),
Unknown(String, Option<Error<Rule>>),
}Expand description
An enumeration type containing representations for all messages supported by the UCI protocol.
Variants§
Uci
The uci engine-bound message.
Debug(bool)
The debug engine-bound message. Its internal property specifies whether debug mode should be enabled (true),
or disabled (false).
IsReady
The isready engine-bound message.
Register
The register engine-bound message.
Fields
Position
The position engine-bound message.
Fields
startpos: boolIf true, it denotes the starting chess position. Generally, if this property is true, then the value of
the fen property will be None.
fen: Option<UciFen>The FEN format representation of a chess position.
SetOption
The setoption engine-bound message.
Fields
UciNewGame
The ucinewgame engine-bound message.
Stop
The stop engine-bound message.
PonderHit
The ponderhit engine-bound message.
Quit
The quit engine-bound message.
Go
The go engine-bound message.
Fields
time_control: Option<UciTimeControl>Time-control-related go parameters (sub-commands).
search_control: Option<UciSearchControl>Search-related go parameters (sub-commands).
Id
The id GUI-bound message.
Fields
The name of the author of the engine.
UciOk
The uciok GUI-bound message.
ReadyOk
The readyok GUI-bound message.
BestMove
The bestmove GUI-bound message.
Fields
CopyProtection(ProtectionState)
The copyprotection GUI-bound message.
Registration(ProtectionState)
The registration GUI-bound message.
Option(UciOptionConfig)
The option GUI-bound message.
Info(Vec<UciInfoAttribute>)
The info GUI-bound message.
Unknown(String, Option<Error<Rule>>)
Indicating unknown message.
Implementations§
Source§impl UciMessage
impl UciMessage
Sourcepub fn register_later() -> UciMessage
pub fn register_later() -> UciMessage
Constructs a register later UciMessage::Register message.
Sourcepub fn register_code(name: &str, code: &str) -> UciMessage
pub fn register_code(name: &str, code: &str) -> UciMessage
Constructs a register <code> <name> UciMessage::Register message.
Sourcepub fn go() -> UciMessage
pub fn go() -> UciMessage
Constructs an empty UciMessage::Register message.
Sourcepub fn go_ponder() -> UciMessage
pub fn go_ponder() -> UciMessage
Construct a go ponder UciMessage::Register message.
Sourcepub fn go_infinite() -> UciMessage
pub fn go_infinite() -> UciMessage
Constructs a go infinite UciMessage::Register message.
Sourcepub fn go_movetime(milliseconds: Duration) -> UciMessage
pub fn go_movetime(milliseconds: Duration) -> UciMessage
Constructs a go movetime <milliseconds> UciMessage::Register message, with
milliseconds as the argument.
Sourcepub fn id_name(name: &str) -> UciMessage
pub fn id_name(name: &str) -> UciMessage
Constructs an id <name> GUI-bound message.
Constructs an id <name> GUI-bound message.
Sourcepub fn best_move(best_move: UciMove) -> UciMessage
pub fn best_move(best_move: UciMove) -> UciMessage
Constructs a bestmove GUI-bound message without the ponder move.
Sourcepub fn best_move_with_ponder(best_move: UciMove, ponder: UciMove) -> UciMessage
pub fn best_move_with_ponder(best_move: UciMove, ponder: UciMove) -> UciMessage
Constructs a bestmove GUI-bound message with the ponder move.
Sourcepub fn info_string(s: String) -> UciMessage
pub fn info_string(s: String) -> UciMessage
Constructs an info string ... message.
Sourcepub fn direction(&self) -> CommunicationDirection
pub fn direction(&self) -> CommunicationDirection
Returns whether the command was meant for the engine or for the GUI.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
If this UciMessage is a UciMessage::SetOption and the value of that option is a bool, this method returns
the bool value, otherwise it returns None.
Sourcepub fn as_i32(&self) -> Option<i32>
pub fn as_i32(&self) -> Option<i32>
If this UciMessage is a UciMessage::SetOption and the value of that option is an integer, this method
returns the i32 value of the integer, otherwise it returns None.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Return true if this UciMessage is of variant UnknownMessage.
Trait Implementations§
Source§impl AsRef<UciMessage> for ByteVecUciMessage
impl AsRef<UciMessage> for ByteVecUciMessage
Source§fn as_ref(&self) -> &UciMessage
fn as_ref(&self) -> &UciMessage
Source§impl Clone for UciMessage
impl Clone for UciMessage
Source§fn clone(&self) -> UciMessage
fn clone(&self) -> UciMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more