[][src]Trait prompts::Prompt

pub trait Prompt<T> {
    fn run<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>, ErrorKind>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn display(&mut self) -> Result<()>;
fn handle_key_event(&mut self, event: KeyEvent); }

Base prompt trait

You must use this when using any of the prompts in this crate

Required methods

fn run<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<T>, ErrorKind>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

fn display(&mut self) -> Result<()>

fn handle_key_event(&mut self, event: KeyEvent)

Loading content...

Implementors

impl Prompt<bool> for ConfirmPrompt[src]

fn run<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, ErrorKind>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Runs the prompt

Stops either when the user selects an option, an error occurs, or the prompt is aborted by the user using CTRL+c, CTRL+z or ESC.

impl Prompt<String> for TextPrompt[src]

impl<T: Clone + Send + Display> Prompt<T> for AutocompletePrompt<T>[src]

fn run<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<T>, ErrorKind>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Runs the prompt

Stops either when the user selects an option, an error occurs, or the prompt is aborted by the user using CTRL+c, CTRL+z or ESC.

impl<T: Clone + Send + Display> Prompt<T> for SelectPrompt<T>[src]

fn run<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<T>, ErrorKind>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Runs the prompt

Stops either when the user selects an option, an error occurs, or the prompt is aborted by the user using CTRL+c, CTRL+z or ESC.

Loading content...