[][src]Enum vampirc_uci::uci::UciMessage

pub enum UciMessage {
    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>>),
}

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 of Register

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.

Position

The position engine-bound message.

Fields of Position

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.

SetOption

The setoption engine-bound message.

Fields of SetOption

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.

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 of Go

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 of Id

name: Option<String>

The name of the engine, possibly including the version.

author: Option<String>

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 of BestMove

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.

CopyProtection(ProtectionState)

The copyprotection GUI-bound message.

Registration(ProtectionState)

The registration GUI-bound message.

The option GUI-bound message.

The info GUI-bound message.

Indicating unknown message.

Implementations

impl UciMessage[src]

pub fn register_later() -> UciMessage[src]

Constructs a register later UciMessage::Register message.

pub fn register_code(name: &str, code: &str) -> UciMessage[src]

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

pub fn go() -> UciMessage[src]

Constructs an empty UciMessage::Register message.

pub fn go_ponder() -> UciMessage[src]

Construct a go ponder UciMessage::Register message.

pub fn go_infinite() -> UciMessage[src]

Constructs a go infinite UciMessage::Register message.

pub fn go_movetime(milliseconds: Duration) -> UciMessage[src]

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

pub fn id_name(name: &str) -> UciMessage[src]

Constructs an id <name> GUI-bound message.

pub fn id_author(author: &str) -> UciMessage[src]

Constructs an id <name> GUI-bound message.

pub fn best_move(best_move: UciMove) -> UciMessage[src]

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

pub fn best_move_with_ponder(best_move: UciMove, ponder: UciMove) -> UciMessage[src]

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

pub fn info_string(s: String) -> UciMessage[src]

Constructs an info string ... message.

pub fn direction(&self) -> CommunicationDirection[src]

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

pub fn as_bool(&self) -> Option<bool>[src]

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.

pub fn as_i32(&self) -> Option<i32>[src]

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.

pub fn is_unknown(&self) -> bool[src]

Return true if this UciMessage is of variant UnknownMessage.

Trait Implementations

impl AsRef<UciMessage> for ByteVecUciMessage[src]

impl Clone for UciMessage[src]

impl Debug for UciMessage[src]

impl Display for UciMessage[src]

impl Eq for UciMessage[src]

impl From<UciMessage> for ByteVecUciMessage[src]

impl Hash for UciMessage[src]

impl Into<UciMessage> for ByteVecUciMessage[src]

impl PartialEq<UciMessage> for UciMessage[src]

impl Serializable for UciMessage[src]

fn serialize(&self) -> String[src]

Serializes the command into a String.

Examples

use vampirc_uci::{UciMessage, Serializable};

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

impl StructuralEq for UciMessage[src]

impl StructuralPartialEq for UciMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.