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;

    // Provided method
    fn detect_input(&self, input: &TurnInput<'_>) -> 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.

Provided Methods§

Source

fn detect_input(&self, input: &TurnInput<'_>) -> TurnState

Classify with the full input (screen + OSC evidence). Screen-only recognizers get this for free; the manifest recognizer overrides it to use OSC title/progress rules.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§