pub trait LlmSpawnBackend: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn default_binary_name(&self) -> &'static str;
// Provided methods
fn resolve_binary(
&self,
override_path: Option<&Path>,
) -> Result<PathBuf, AppError> { ... }
fn spawn_child(&self, cmd: &mut Command) -> Result<Child> { ... }
}Expand description
Common surface for LLM CLI spawn adapters (claude, codex, …).
Implementations resolve the backend binary and spawn a prepared
Command. Argument construction and stdout parsing remain outside
this trait (see super::VersionAdapter for version/flag adaptation).
Required Methods§
Sourcefn default_binary_name(&self) -> &'static str
fn default_binary_name(&self) -> &'static str
Default binary basename looked up on PATH when no override is set.
Provided Methods§
Sourcefn resolve_binary(
&self,
override_path: Option<&Path>,
) -> Result<PathBuf, AppError>
fn resolve_binary( &self, override_path: Option<&Path>, ) -> Result<PathBuf, AppError>
Resolve the executable path, honouring an optional absolute/relative override.
§Errors
Returns AppError::BinaryNotFound when neither the override nor the
default basename can be located via which.
Sourcefn spawn_child(&self, cmd: &mut Command) -> Result<Child>
fn spawn_child(&self, cmd: &mut Command) -> Result<Child>
Spawn a prepared command under the shared process policy.
Default implementation uses plain Command::spawn. Call sites that
need setsid / RLIMIT_AS should continue to use
commands::claude_runner::spawn_with_memory_limit until that helper is
relocated into this module (follow-up).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".