Skip to main content

AiBackend

Trait AiBackend 

Source
pub trait AiBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn invoke(
        &self,
        req: &Request,
        ctx: &BackendCtx<'_>,
    ) -> Result<Response, String>;
}
Expand description

A backend dispatches a Request to an underlying CLI / API and returns a Response. Implementations live in backends/<name>.rs.

Required Methods§

Source

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

Source

fn invoke( &self, req: &Request, ctx: &BackendCtx<'_>, ) -> Result<Response, String>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§