Trait async_uci::engine::ChessEngine
source · pub trait ChessEngine: Sized {
// Required methods
fn new<'life0, 'async_trait>(
exe_path: &'life0 str
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_uci<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn new_game<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_position<'life0, 'life1, 'async_trait>(
&'life0 mut self,
position: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn go_infinite<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn go_depth<'life0, 'async_trait>(
&'life0 mut self,
plies: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn go_time<'life0, 'async_trait>(
&'life0 mut self,
ms: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn go_mate<'life0, 'async_trait>(
&'life0 mut self,
mate_in: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_evaluation<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<Evaluation>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_options<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Vec<EngineOption>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_option<'life0, 'async_trait>(
&'life0 mut self,
option: String,
value: String
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
ChessEngine trait can be implemented for structures that implement the UCI Protocol
Required Methods§
sourcefn new<'life0, 'async_trait>(
exe_path: &'life0 str
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new<'life0, 'async_trait>( exe_path: &'life0 str ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Create new engine from executable
sourcefn start_uci<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_uci<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Start the UCI Protocol
sourcefn new_game<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_game<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Notify engine of new game start
sourcefn set_position<'life0, 'life1, 'async_trait>(
&'life0 mut self,
position: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_position<'life0, 'life1, 'async_trait>( &'life0 mut self, position: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Notify engine of new position to search
sourcefn go_infinite<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn go_infinite<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Notify engine to search for best move until explicitly stopped
sourcefn go_depth<'life0, 'async_trait>(
&'life0 mut self,
plies: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn go_depth<'life0, 'async_trait>( &'life0 mut self, plies: usize ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Notify engine to search for best move to a certain depth
sourcefn go_time<'life0, 'async_trait>(
&'life0 mut self,
ms: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn go_time<'life0, 'async_trait>( &'life0 mut self, ms: usize ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Notify engine to search for best move for a set time
sourcefn go_mate<'life0, 'async_trait>(
&'life0 mut self,
mate_in: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn go_mate<'life0, 'async_trait>( &'life0 mut self, mate_in: usize ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Notify engine to search for a mate in a certain number of moves
sourcefn stop<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Notify engine to stop current search
sourcefn get_evaluation<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<Evaluation>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_evaluation<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Option<Evaluation>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Retrieve the latest evaluation from the engine
sourcefn get_options<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Vec<EngineOption>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_options<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Vec<EngineOption>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Retrieve the list of available options from the engine