1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use async_trait::async_trait;
use eyre::Result;

pub mod terminal;

use makeup_console::Keypress;
pub use terminal::TerminalInput;

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum InputFrame {
    Frame(Keypress),
    Empty,
    End,
}

#[async_trait]
pub trait Input: std::fmt::Debug + Send + Sync + Clone {
    async fn next_frame(&self) -> Result<InputFrame>;
}