Skip to main content

RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn initialize(&mut self) -> Result<(), RuntimeError>;
    fn prepare(
        &mut self,
        task_id: Uuid,
        worktree: &Path,
    ) -> Result<(), RuntimeError>;
    fn execute(
        &mut self,
        input: ExecutionInput,
    ) -> Result<ExecutionReport, RuntimeError>;
    fn terminate(&mut self) -> Result<(), RuntimeError>;
    fn config(&self) -> &AdapterConfig;
}
Expand description

Trait for runtime adapters.

All adapters must implement this trait to be usable by Hivemind.

Required Methods§

Source

fn name(&self) -> &str

Returns the adapter name.

Source

fn initialize(&mut self) -> Result<(), RuntimeError>

Initializes the adapter.

Source

fn prepare( &mut self, task_id: Uuid, worktree: &Path, ) -> Result<(), RuntimeError>

Prepares the adapter for execution.

Source

fn execute( &mut self, input: ExecutionInput, ) -> Result<ExecutionReport, RuntimeError>

Executes the runtime with the given input.

Source

fn terminate(&mut self) -> Result<(), RuntimeError>

Terminates execution (if running).

Source

fn config(&self) -> &AdapterConfig

Returns the adapter configuration.

Implementors§