[][src]Trait cursive::CursiveExt

pub trait CursiveExt {
    type Cursive;
    fn default() -> Self::Cursive;
fn ncurses() -> Result<Self::Cursive>; }

Extension trait for the Cursive root to simplify initialization.

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


use cursive::{Cursive, CursiveExt};

// Use `Cursive::default()` to pick one of the enabled backends,
// depending on cargo features.
let mut siv = Cursive::default();

// Or explicitly use a specific backend
#[cfg(feature = "ncurses-backend")]
let mut siv = Cursive::ncurses();
#[cfg(feature = "panncurses-backend")]
let mut siv = Cursive::pancurses();
#[cfg(feature = "termion-backend")]
let mut siv = Cursive::termion();
#[cfg(feature = "crossterm-backend")]
let mut siv = Cursive::crossterm();
#[cfg(feature = "blt-backend")]
let mut siv = Cursive::blt();

Associated Types

type Cursive

Type of the returned cursive root.

Loading content...

Required methods

fn default() -> Self::Cursive

Tries to use one of the enabled backends.

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


If the backend initialization fails.

fn ncurses() -> Result<Self::Cursive>

Creates a new Cursive root using a ncurses backend.

Loading content...


impl CursiveExt for Cursive[src]

type Cursive = Self

Loading content...