Skip to main content

Engine

Trait Engine 

Source
pub trait Engine: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn capabilities(&self) -> EngineCapabilities;
    fn dispatch(&self, model: &str, task: Task) -> Result<TaskResult>;

    // Provided method
    fn dispatch_with_source(
        &self,
        model: &str,
        task: Task,
        _source: &ModelSource,
    ) -> Result<TaskResult> { ... }
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn capabilities(&self) -> EngineCapabilities

Source

fn dispatch(&self, model: &str, task: Task) -> Result<TaskResult>

Provided Methods§

Source

fn dispatch_with_source( &self, model: &str, task: Task, _source: &ModelSource, ) -> Result<TaskResult>

Dispatch with the studio’s ModelSource attached. Engines that need it (download URLs / CLI defaults) override this; engines that don’t (synthetic) keep using the plain dispatch method via the default impl below.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§