bitrouter-tui 0.1.4

Interactive terminal UI for BitRouter
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crossterm::event::{Event, EventStream};
use futures::StreamExt;

pub struct EventHandler {
    stream: EventStream,
}

impl EventHandler {
    pub fn new() -> Self {
        Self {
            stream: EventStream::new(),
        }
    }

    pub async fn next(&mut self) -> Option<Event> {
        self.stream.next().await?.ok()
    }
}