pub trait IsolationBackend: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 SpawnOpts,
) -> Pin<Box<dyn Future<Output = Result<IsolationEnv, MachiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn cleanup<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 IsolationEnv,
) -> Pin<Box<dyn Future<Output = Result<(), MachiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Prepares (and later tears down) an execution environment for a child agent.
Maturity: core (port). Default adapter is InProcessIsolation;
worktree / OS sandbox are product adapters, not kernel defaults.
Required Methods§
Sourcefn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 SpawnOpts,
) -> Pin<Box<dyn Future<Output = Result<IsolationEnv, MachiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 SpawnOpts,
) -> Pin<Box<dyn Future<Output = Result<IsolationEnv, MachiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Allocate environment for this spawn.
§Errors
Backend-specific failures map to ErrorCode::HostIsolation.
Sourcefn cleanup<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 IsolationEnv,
) -> Pin<Box<dyn Future<Output = Result<(), MachiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cleanup<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 IsolationEnv,
) -> Pin<Box<dyn Future<Output = Result<(), MachiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".