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§
fn name(&self) -> &'static str
fn capabilities(&self) -> EngineCapabilities
fn dispatch(&self, model: &str, task: Task) -> Result<TaskResult>
Provided Methods§
Sourcefn dispatch_with_source(
&self,
model: &str,
task: Task,
_source: &ModelSource,
) -> Result<TaskResult>
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".