pub trait Prompt: Send + Sync {
type PromptError: Error + Send + Sync;
// Required method
fn prompt(
&self,
prompt: &str,
) -> impl Future<Output = Result<String, Self::PromptError>> + Send;
}Expand description
A trait representing a prompt-based interaction mechanism.
This trait defines the behavior of components that process user prompts and return responses asynchronously.
§Associated Types
PromptError: Represents errors that may occur during prompt processing.
§Requirements
Implementors of this trait must ensure thread safety (Send and Sync)
and provide an asynchronous implementation for the prompt method.
Required Associated Types§
Sourcetype PromptError: Error + Send + Sync
type PromptError: Error + Send + Sync
The error type associated with the prompt operation.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".