pub trait SandboxExecutor: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn isolation_level(&self) -> IsolationLevel;
fn is_available(&self) -> Pin<Box<dyn Future<Output = bool> + Send + '_>>;
fn execute(
&self,
command: SandboxCommand,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ReactError>> + Send + '_>>;
// Provided methods
fn execute_with_limits(
&self,
command: SandboxCommand,
limits: ResourceLimits,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ReactError>> + Send + '_>> { ... }
fn cleanup(
&self,
) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>> { ... }
}Expand description
Sandbox executor unified interface.
All three layers (Local / Docker / K8s) implement this trait.
Required Methods§
Sourcefn isolation_level(&self) -> IsolationLevel
fn isolation_level(&self) -> IsolationLevel
Current isolation level
Sourcefn is_available(&self) -> Pin<Box<dyn Future<Output = bool> + Send + '_>>
fn is_available(&self) -> Pin<Box<dyn Future<Output = bool> + Send + '_>>
Check if the executor is available
Sourcefn execute(
&self,
command: SandboxCommand,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ReactError>> + Send + '_>>
fn execute( &self, command: SandboxCommand, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ReactError>> + Send + '_>>
Execute a command
Provided Methods§
Sourcefn execute_with_limits(
&self,
command: SandboxCommand,
limits: ResourceLimits,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ReactError>> + Send + '_>>
fn execute_with_limits( &self, command: SandboxCommand, limits: ResourceLimits, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, ReactError>> + Send + '_>>
Execute a command with resource limits