pub trait ProcessRunner: Send + Sync {
// Required methods
fn start<'life0, 'async_trait>(
&'life0 self,
config: ServerConfig,
) -> Pin<Box<dyn Future<Output = Result<ProcessHandle, ProcessError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ProcessHandle,
) -> Pin<Box<dyn Future<Output = Result<(), ProcessError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Process runner for managing model server processes.
This trait abstracts process management for testability and potential alternative backends (local, remote, containerized).
§Design Rules
- Express intent, not implementation detail
- No CLI/Tauri/Axum concerns in signatures
- Must support: mock runner, remote runner, alternative inference backends
Required Methods§
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
config: ServerConfig,
) -> Pin<Box<dyn Future<Output = Result<ProcessHandle, ProcessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
config: ServerConfig,
) -> Pin<Box<dyn Future<Output = Result<ProcessHandle, ProcessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start a model server with the given configuration.
Returns a handle that can be used to manage the process.
Sourcefn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ProcessHandle,
) -> Pin<Box<dyn Future<Output = Result<(), ProcessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ProcessHandle,
) -> Pin<Box<dyn Future<Output = Result<(), ProcessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop a running server.
Returns Err(ProcessError::NotRunning) if the process isn’t running.