pub trait SpawnerBackend: Send + Sync {
// Required methods
fn spawn<'life0, 'async_trait>(
&'life0 self,
config: ProcessConfig,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_running<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn backend_type(&self) -> &'static str;
// Provided method
fn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()> { ... }
}Expand description
Trait for process spawning backends.
Required Methods§
Sourcefn spawn<'life0, 'async_trait>(
&'life0 self,
config: ProcessConfig,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn<'life0, 'async_trait>(
&'life0 self,
config: ProcessConfig,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn a daemon process.
Sourcefn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop a spawned process.
Sourcefn is_running<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_running<'life0, 'life1, 'async_trait>(
&'life0 self,
process: &'life1 SpawnedProcess,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a process is still running.
Sourcefn backend_type(&self) -> &'static str
fn backend_type(&self) -> &'static str
Get the backend type name.
Provided Methods§
Sourcefn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()>
fn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()>
Synchronous bounded stop of a TRACKED direct child, used only by the
launch-transaction guard’s Drop for cancellation cleanup where no
async runtime work is guaranteed (#1585). Backends that retain child
handles override this to stop through the retained handle — never a
blind by-PID signal; the default fails honestly.