INNER CODE UNIT · Rust

run_loop

kaplanelad/shellfirm · shellfirm/src/tui/mod.rs:139

fn run_loop<B: ratatui::backend::Backend>(
    terminal: &mut Terminal<B>,
    app: &mut app::App,
) -> Result<()> {
    use crossterm::event::{self, Event};
    while app.running {
        terminal
            .draw(|f| render::draw(f, app))
            .map_err(|e| Error::Other(e.to_string()))?;
        if let Event::Key(key) =
            event::read().map_err(|e| Error::Other(e.to_string()))?
        {
            app.handle_key(key);
        }
    }
    Ok(())
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…