Trait cursive::CursiveExt[][src]

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.

Examples

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[src]

Type of the returned cursive root.

Loading content...

Required methods

fn default() -> Self::Cursive[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.

fn ncurses() -> Result<Self::Cursive>[src]

Creates a new Cursive root using a ncurses backend.

Loading content...

Implementors

impl CursiveExt for Cursive[src]

type Cursive = Self

Loading content...