Skip to main content

Executor

Trait Executor 

Source
pub trait Executor {
    // Required methods
    fn default_model(&self) -> &Arc<Option<String>> ;
    fn execute(&self, task: Task) -> impl Future<Output = Result<Response>>;
}
Expand description

Executes tasks independently of their transport.

An unsuccessful Response is distinct from an execution error. Returned futures do not promise Send, and the trait is not dyn-compatible.

Required Methods§

Source

fn default_model(&self) -> &Arc<Option<String>>

Returns the fallback model used when a task does not specify one.

Source

fn execute(&self, task: Task) -> impl Future<Output = Result<Response>>

Executes one task; Err indicates execution failed before a response.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§