Skip to main content

ElicitationClientExt

Trait ElicitationClientExt 

Source
pub trait ElicitationClientExt: ElicitationClient {
    // Provided methods
    fn confirm(
        &self,
        message: &str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, ElicitationError>> + Send + '_>> { ... }
    fn prompt_text(
        &self,
        message: &str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, ElicitationError>> + Send + '_>> { ... }
    fn choose(
        &self,
        message: &str,
        options: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, ElicitationError>> + Send + '_>> { ... }
    fn prompt_number(
        &self,
        message: &str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<f64>, ElicitationError>> + Send + '_>> { ... }
}
Expand description

Extension trait for convenient elicitation methods.

Provided Methods§

Source

fn confirm( &self, message: &str, ) -> Pin<Box<dyn Future<Output = Result<bool, ElicitationError>> + Send + '_>>

Request a simple yes/no confirmation from the user.

Source

fn prompt_text( &self, message: &str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, ElicitationError>> + Send + '_>>

Request text input from the user.

Source

fn choose( &self, message: &str, options: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, ElicitationError>> + Send + '_>>

Request the user to choose from a list of options.

Source

fn prompt_number( &self, message: &str, ) -> Pin<Box<dyn Future<Output = Result<Option<f64>, ElicitationError>> + Send + '_>>

Request a number from the user.

Implementors§