pub enum EngineCommand {
Id(IdParams),
BestMove(BestMoveParams),
Checkmate(CheckmateParams),
Info(Vec<InfoParams>),
Option(OptionParams),
ReadyOk,
UsiOk,
Unknown,
}Expand description
Represents a USI command sent from the engine.
§Examples
use usi::{EngineCommand, BestMoveParams};
let cmd = EngineCommand::parse("bestmove 7g7f ponder 8c8d").unwrap();
match cmd {
EngineCommand::BestMove(BestMoveParams::MakeMove(ref m, Some(ref pm))) => {
assert_eq!("7g7f", *m);
assert_eq!("8c8d", *pm);
},
_ => unreachable!(),
}Variants§
Id(IdParams)
BestMove(BestMoveParams)
Checkmate(CheckmateParams)
Info(Vec<InfoParams>)
Option(OptionParams)
ReadyOk
UsiOk
Unknown
Implementations§
Source§impl EngineCommand
impl EngineCommand
Trait Implementations§
Source§impl Clone for EngineCommand
impl Clone for EngineCommand
Source§fn clone(&self) -> EngineCommand
fn clone(&self) -> EngineCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EngineCommand
impl Debug for EngineCommand
Source§impl Hash for EngineCommand
impl Hash for EngineCommand
Source§impl PartialEq for EngineCommand
impl PartialEq for EngineCommand
impl Eq for EngineCommand
impl StructuralPartialEq for EngineCommand
Auto Trait Implementations§
impl Freeze for EngineCommand
impl RefUnwindSafe for EngineCommand
impl Send for EngineCommand
impl Sync for EngineCommand
impl Unpin for EngineCommand
impl UnwindSafe for EngineCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more