pub trait CursiveExt {
    fn run(&mut self);
    fn run_ncurses(&mut self) -> Result<()>;
    fn run_pancurses(&mut self) -> Result<()>;
    fn run_termion(&mut self) -> Result<()>;
    fn run_crossterm(&mut self) -> Result<(), ErrorKind>;
    fn run_blt(&mut self);
}
Expand description

Extension trait for the Cursive root to simplify initialization.

It brings backend-specific methods to initialize a Cursive root.

Examples

use cursive::{Cursive, CursiveExt};

let mut siv = Cursive::new();

// Use `CursiveExt::run()` to pick one of the enabled backends,
// depending on cargo features.
siv.run();

// Or explicitly use a specific backend
#[cfg(feature = "ncurses-backend")]
siv.run_ncurses().unwrap();
#[cfg(feature = "panncurses-backend")]
siv.run_pancurses().unwrap();
#[cfg(feature = "termion-backend")]
siv.run_termion().unwrap();
#[cfg(feature = "crossterm-backend")]
siv.run_crossterm().unwrap();
#[cfg(feature = "blt-backend")]
siv.run_blt();

Required Methods

Tries to use one of the enabled backends.

Will fallback to the dummy backend if no other backend feature is enabled.

Panics

If the backend initialization fails.

Available on crate feature ncurses-backend only.

Creates a new Cursive root using a ncurses backend.

Available on crate feature pancurses-backend only.

Creates a new Cursive root using a pancurses backend.

Available on crate feature termion-backend only.

Creates a new Cursive root using a termion backend.

Available on crate feature crossterm-backend only.

Creates a new Cursive root using a crossterm backend.

Available on crate feature blt-backend only.

Creates a new Cursive root using a bear-lib-terminal backend.

Implementors