pub fn start_tui_with_interface<Interface: TUIInterface>(
    interface: Interface,
) -> Result<(), Box<dyn Error>> {
    enable_raw_mode()?;
    let mut stdout = io::stdout();
    execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
    let backend = CrosstermBackend::new(stdout);
    let mut terminal = Terminal::new(backend)?;
    let mut tui = TUI::new(interface);
    loop {
        terminal.draw(|frame| tui.redraw(frame))?;
        if tui.handle_input()? {
            break;
        }
    }
    Ok(())
}
/// Starts a two-pane TUI using the provided `Interface` to update the screen according to cursor
/// movements.
Starts a two-pane TUI using the provided `Interface` to update the screen according to cursor
movements.
Starts a two - pane TUI using the provided ` Interface ` to update the screen according to cursor movements .
pub fn start_tui_with_interface<Interface: TUIInterface>(
    interface: Interface,
) -> Result<(), Box<dyn Error>> {
    enable_raw_mode()?;
    let mut stdout = io::stdout();
    execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
    let backend = CrosstermBackend::new(stdout);
    let mut terminal = Terminal::new(backend)?;
    let mut tui = TUI::new(interface);
    loop {
        terminal.draw(|frame| tui.redraw(frame))?;
        if tui.handle_input()? {
            break;
        }
    }
    Ok(())
}
pub fn start_tui_with_interface < Interface : TUIInterface > ( interface : Interface , ) -> Result < ( ) , Box < dyn Error > > { enable_raw_mode ( ) ? ; let mut stdout = io :: stdout ( ) ; execute ! ( stdout EnterAlternateScreen EnableMouseCapture ) ? ; let backend = CrosstermBackend :: new ( stdout ) ; let mut terminal = Terminal :: new ( backend ) ? ; let mut tui = TUI :: new ( interface ) ; loop { terminal . draw ( | frame | tui . redraw ( frame ) ) ? ; if tui . handle_input ( ) ? { break ; } } Ok ( ( ) ) }
Starts a two-pane TUI using the provided `Interface` to update the screen according to cursor
movements.
Starts a two - pane TUI using the provided ` Interface ` to update the screen according to cursor movements .
interface
Interface