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§
Sourcefn initialize(&mut self) -> Result<(), RuntimeError>
fn initialize(&mut self) -> Result<(), RuntimeError>
Initializes the adapter.
Sourcefn prepare(
&mut self,
task_id: Uuid,
worktree: &Path,
) -> Result<(), RuntimeError>
fn prepare( &mut self, task_id: Uuid, worktree: &Path, ) -> Result<(), RuntimeError>
Prepares the adapter for execution.
Sourcefn execute(
&mut self,
input: ExecutionInput,
) -> Result<ExecutionReport, RuntimeError>
fn execute( &mut self, input: ExecutionInput, ) -> Result<ExecutionReport, RuntimeError>
Executes the runtime with the given input.
Sourcefn terminate(&mut self) -> Result<(), RuntimeError>
fn terminate(&mut self) -> Result<(), RuntimeError>
Terminates execution (if running).
Sourcefn config(&self) -> &AdapterConfig
fn config(&self) -> &AdapterConfig
Returns the adapter configuration.