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§
fn name(&self) -> &'static str
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".