Skip to main content

GameKeyReader

Trait GameKeyReader 

Source
pub trait GameKeyReader {
    // Required method
    fn read_key(&mut self, timeout: Duration) -> Option<GameKey>;
}
Expand description

Abstraction over the terminal so the game can be driven by mock input.

Required Methods§

Source

fn read_key(&mut self, timeout: Duration) -> Option<GameKey>

Blocks up to timeout, returning the next key or None on expiration. None also marks end-of-input for mocked readers.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§