Skip to main content

PromptResponder

Trait PromptResponder 

Source
pub trait PromptResponder: Send + Sync {
    // Required method
    fn respond(&self, ctx: PromptContext<'_>) -> PromptResponse;
}
Expand description

Test seam for the .prompt() shortcut on interactive sources.

When a responder is installed via set_default_prompt_responder, every prompt() call routes through it instead of opening a real prompt. Implement this trait for custom dispatch logic, or use the bundled ScriptedResponder.

Required Methods§

Source

fn respond(&self, ctx: PromptContext<'_>) -> PromptResponse

Produce a response for the given prompt.

Implementors§