Skip to main content

TurnRecognizer

Trait TurnRecognizer 

Source
pub trait TurnRecognizer: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn detect(&self, screen: &[String]) -> TurnState;
}
Expand description

Reads a rendered screen (ANSI already stripped, one String per line) and classifies the current turn state for a specific kind of TUI.

Required Methods§

Source

fn name(&self) -> &'static str

Stable identifier, surfaced in the status footer.

Source

fn detect(&self, screen: &[String]) -> TurnState

Classify the current screen.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§