Enum vampirc_uci::uci::UciMessage
source · [−]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<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.
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.
The position
engine-bound message.
SetOption
Fields
name: String
The name of the option to set.
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
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.
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(String, Option<PestError<Rule>>)
Indicating unknown message.
Implementations
sourceimpl 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
sourceimpl AsRef<UciMessage> for ByteVecUciMessage
impl AsRef<UciMessage> for ByteVecUciMessage
sourcefn as_ref(&self) -> &UciMessage
fn as_ref(&self) -> &UciMessage
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Clone for UciMessage
impl Clone for UciMessage
sourcefn clone(&self) -> UciMessage
fn clone(&self) -> UciMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UciMessage
impl Debug for UciMessage
sourceimpl Display for UciMessage
impl Display for UciMessage
sourceimpl From<UciMessage> for ByteVecUciMessage
impl From<UciMessage> for ByteVecUciMessage
sourcefn from(m: UciMessage) -> Self
fn from(m: UciMessage) -> Self
Converts to this type from the input type.
sourceimpl Hash for UciMessage
impl Hash for UciMessage
sourceimpl Into<UciMessage> for ByteVecUciMessage
impl Into<UciMessage> for ByteVecUciMessage
sourcefn into(self) -> UciMessage
fn into(self) -> UciMessage
Converts this type into the (usually inferred) input type.
sourceimpl PartialEq<UciMessage> for UciMessage
impl PartialEq<UciMessage> for UciMessage
sourcefn eq(&self, other: &UciMessage) -> bool
fn eq(&self, other: &UciMessage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UciMessage) -> bool
fn ne(&self, other: &UciMessage) -> bool
This method tests for !=
.
sourceimpl Serializable for UciMessage
impl Serializable for UciMessage
impl Eq for UciMessage
impl StructuralEq for UciMessage
impl StructuralPartialEq for UciMessage
Auto Trait Implementations
impl RefUnwindSafe for UciMessage
impl Send for UciMessage
impl Sync for UciMessage
impl Unpin for UciMessage
impl UnwindSafe for UciMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more