[][src]Trait cursive::CursiveExt

pub trait CursiveExt {
    pub fn run(&mut self);
pub fn run_ncurses(&mut self) -> Result<()>; }

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

pub fn run(&mut self)[src]

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.

pub fn run_ncurses(&mut self) -> Result<()>[src]

Creates a new Cursive root using a ncurses backend.

Loading content...

Implementors

impl CursiveExt for Cursive[src]

Loading content...