pub struct Analyzer<W: WarningHandling = WarningsAsErrors> {
pub stderr: Option<ChildStderr>,
pub child_process: Child,
/* private fields */
}Expand description
An instance of the KataGo analysis engine, launched as a child process.
Drop this to close the engine’s stdin and request KataGo to exit. Responses will continue to be processed until the engine actually exits.
Fields§
§stderr: Option<ChildStderr>The analysis engine’s stderr output, if available.
child_process: ChildThe engine process.
Implementations§
Source§impl<W: WarningHandling> Analyzer<W>
impl<W: WarningHandling> Analyzer<W>
Sourcepub async fn analyze(
&mut self,
request: AnalysisRequest,
) -> WarningResult<Option<AnalysisResult>, W>
pub async fn analyze( &mut self, request: AnalysisRequest, ) -> WarningResult<Option<AnalysisResult>, W>
Analyzes the final position in the game and returns a single result.
Sourcepub async fn analyze_position(
&mut self,
request: AnalysisRequest,
position: usize,
) -> WarningResult<Option<AnalysisResult>, W>
pub async fn analyze_position( &mut self, request: AnalysisRequest, position: usize, ) -> WarningResult<Option<AnalysisResult>, W>
Analyzes a specific position in the game and returns a single result.
Sourcepub async fn analyze_game(
&mut self,
request: AnalysisRequest,
) -> WarningResult<HashMap<usize, AnalysisResult>, W>
pub async fn analyze_game( &mut self, request: AnalysisRequest, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>
Analyzes all moves in the game and returns a collection of results, one for each position.
Sourcepub async fn analyze_positions(
&mut self,
request: AnalysisRequest,
analyze_turns: Vec<usize>,
) -> WarningResult<HashMap<usize, AnalysisResult>, W>
pub async fn analyze_positions( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>
Analyzes the specified positions in the game and returns a collection of results, one for each position.
Sourcepub async fn start_analyze(
&mut self,
request: AnalysisRequest,
) -> Result<AnalysisProgress<W>>
pub async fn start_analyze( &mut self, request: AnalysisRequest, ) -> Result<AnalysisProgress<W>>
Starts analyzing the final position in the game and returns a progress object which can be polled for updates.
Sourcepub async fn start_analyze_position(
&mut self,
request: AnalysisRequest,
position: usize,
) -> Result<AnalysisProgress<W>>
pub async fn start_analyze_position( &mut self, request: AnalysisRequest, position: usize, ) -> Result<AnalysisProgress<W>>
Starts analyzing a specific position in the game and returns a progress object which can be polled for updates.
Sourcepub async fn start_analyze_game(
&mut self,
request: AnalysisRequest,
) -> Result<GameAnalysisProgress<W>>
pub async fn start_analyze_game( &mut self, request: AnalysisRequest, ) -> Result<GameAnalysisProgress<W>>
Starts analyzing all moves in the game and returns a collection of progress objects.
Sourcepub async fn start_analyze_positions(
&mut self,
request: AnalysisRequest,
analyze_turns: Vec<usize>,
) -> Result<GameAnalysisProgress<W>>
pub async fn start_analyze_positions( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, ) -> Result<GameAnalysisProgress<W>>
Starts analyzing the specified positions in the game and returns a collection of progress objects.
Sourcepub async fn analyze_game_prioritized(
&mut self,
request: AnalysisRequest,
priorities: Vec<i32>,
) -> WarningResult<HashMap<usize, AnalysisResult>, W>
pub async fn analyze_game_prioritized( &mut self, request: AnalysisRequest, priorities: Vec<i32>, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>
Analyzes all moves in the game with the given priorities and returns a collection of results, one for each position.
priorities must have length equal to one more than the number of moves in the game.
Sourcepub async fn analyze_positions_prioritized(
&mut self,
request: AnalysisRequest,
analyze_turns: Vec<usize>,
priorities: Vec<i32>,
) -> WarningResult<HashMap<usize, AnalysisResult>, W>
pub async fn analyze_positions_prioritized( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, priorities: Vec<i32>, ) -> WarningResult<HashMap<usize, AnalysisResult>, W>
Analyzes the specified positions in the game with the given priorities and returns a collection of results, one for each position.
priorities must have the same length as analyze_turns.
Sourcepub async fn start_analyze_game_prioritized(
&mut self,
request: AnalysisRequest,
priorities: Vec<i32>,
) -> Result<GameAnalysisProgress<W>>
pub async fn start_analyze_game_prioritized( &mut self, request: AnalysisRequest, priorities: Vec<i32>, ) -> Result<GameAnalysisProgress<W>>
Starts analyzing all moves in the game with the given priorities and returns a collection of progress objects.
priorities must have length equal to one more than the number of moves in the game.
Sourcepub async fn start_analyze_positions_prioritized(
&mut self,
request: AnalysisRequest,
analyze_turns: Vec<usize>,
priorities: Vec<i32>,
) -> Result<GameAnalysisProgress<W>>
pub async fn start_analyze_positions_prioritized( &mut self, request: AnalysisRequest, analyze_turns: Vec<usize>, priorities: Vec<i32>, ) -> Result<GameAnalysisProgress<W>>
Starts analyzing the specified positions in the game with the given priorities and returns a collection of progress objects.
priorities must have the same length as analyze_turns.
Sourcepub async fn query_version(&mut self) -> WarningResult<VersionInfo, W>
pub async fn query_version(&mut self) -> WarningResult<VersionInfo, W>
Requests KataGo’s version information.
Sourcepub async fn clear_cache(&mut self) -> WarningResult<(), W>
pub async fn clear_cache(&mut self) -> WarningResult<(), W>
Clears the neural network cache.
Sourcepub async fn terminate(
&mut self,
progress: &AnalysisProgress,
) -> WarningResult<(), W>
pub async fn terminate( &mut self, progress: &AnalysisProgress, ) -> WarningResult<(), W>
Terminates the analysis for a single position.
progress may still be used to wait for the final result.
Sourcepub async fn terminate_game(
&mut self,
progress: &GameAnalysisProgress,
) -> WarningResult<(), W>
pub async fn terminate_game( &mut self, progress: &GameAnalysisProgress, ) -> WarningResult<(), W>
Terminates the analysis for all positions in a game.
progress may still be used to wait for the final results.
Sourcepub async fn terminate_positions(
&mut self,
progress: &GameAnalysisProgress,
turn_numbers: Vec<usize>,
) -> WarningResult<(), W>
pub async fn terminate_positions( &mut self, progress: &GameAnalysisProgress, turn_numbers: Vec<usize>, ) -> WarningResult<(), W>
Terminates the analysis for the specified positions in a game.
progress may still be used to wait for the final results.
Sourcepub async fn terminate_all(&mut self) -> WarningResult<(), W>
pub async fn terminate_all(&mut self) -> WarningResult<(), W>
Terminates all pending analysis requests.
Sourcepub async fn terminate_all_positions(
&mut self,
turn_numbers: Vec<usize>,
) -> WarningResult<(), W>
pub async fn terminate_all_positions( &mut self, turn_numbers: Vec<usize>, ) -> WarningResult<(), W>
Terminates all pending analysis requests for the specified positions.
Sourcepub async fn query_models(&mut self) -> WarningResult<Vec<Model>, W>
pub async fn query_models(&mut self) -> WarningResult<Vec<Model>, W>
Requests information about the available neural network models.