Skip to main content

InteractionHandler

Trait InteractionHandler 

Source
pub trait InteractionHandler: Send + Sync {
    // Required method
    fn ask_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        question: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Host callback backing the ask_user tool.

Required Methods§

Source

fn ask_user<'life0, 'life1, 'async_trait>( &'life0 self, question: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl InteractionHandler for NonInteractiveHandler

Source§

impl<F, Fut> InteractionHandler for AsyncFnInteractionHandler<F>
where F: Fn(String) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<String>> + Send + 'static,

Source§

impl<F> InteractionHandler for FnInteractionHandler<F>
where F: Fn(&str) -> Result<String> + Send + Sync + 'static,