pub trait CodeSandbox: Send + Sync {
// Required method
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
language: Language,
timeout_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<RunResult, SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for sandbox backends that execute code in an isolated environment.
Required Methods§
Sourcefn run<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
language: Language,
timeout_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<RunResult, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
language: Language,
timeout_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<RunResult, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the given code in the specified language.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".