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(StringOption<PestError<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

Fields

later: bool

The register later engine-bound message.

name: Option<String>

The name part of the register <code> <name> engine-bound message.

code: Option<String>

The code part of the register <code> <name> engine-bound message.

The register engine-bound message.

Position

Fields

startpos: bool

If 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.

moves: Vec<UciMove>

A list of moves to apply to the position.

The position engine-bound message.

SetOption

Fields

name: String

The name of the option to set.

value: Option<String>

The value of the option to set. If the option has no value, this should be None.

The setoption engine-bound message.

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

Fields

time_control: Option<UciTimeControl>

Time-control-related go parameters (sub-commands).

search_control: Option<UciSearchControl>

Search-related go parameters (sub-commands).

The go engine-bound message.

Id

Fields

name: Option<String>

The name of the engine, possibly including the version.

author: Option<String>

The name of the author of the engine.

The id GUI-bound message.

UciOk

The uciok GUI-bound message.

ReadyOk

The readyok GUI-bound message.

BestMove

Fields

best_move: UciMove

The move the engine thinks is the best one in the position.

ponder: Option<UciMove>

The move the engine would like to ponder on.

The bestmove GUI-bound message.

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(StringOption<PestError<Rule>>)

Indicating unknown message.

Implementations

Constructs a register later UciMessage::Register message.

Constructs a register <code> <name> UciMessage::Register message.

Constructs an empty UciMessage::Register message.

Construct a go ponder UciMessage::Register message.

Constructs a go infinite UciMessage::Register message.

Constructs a go movetime <milliseconds> UciMessage::Register message, with milliseconds as the argument.

Constructs an id <name> GUI-bound message.

Constructs an id <name> GUI-bound message.

Constructs a bestmove GUI-bound message without the ponder move.

Constructs a bestmove GUI-bound message with the ponder move.

Constructs an info string ... message.

Returns whether the command was meant for the engine or for the GUI.

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.

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.

Return true if this UciMessage is of variant UnknownMessage.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Converts this type into the (usually inferred) input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serializes the command into a String.

Examples
use vampirc_uci::{UciMessage, Serializable};

println!("{}", UciMessage::Uci.serialize()); // Should print `uci`.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.