pub trait Sandbox: Send + Sync {
// Required methods
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for sandbox implementations.
A sandbox provides isolated code execution with resource limits.
Required Methods§
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Trait Implementations§
Source§impl Sandbox for Box<dyn Sandbox>
Implementation of Sandbox for Box<dyn Sandbox>.
This allows using trait objects with generic sandbox validators.
impl Sandbox for Box<dyn Sandbox>
Implementation of Sandbox for Box<dyn Sandbox>.
This allows using trait objects with generic sandbox validators.
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute code in the sandbox. Read more
Implementations on Foreign Types§
Source§impl Sandbox for Box<dyn Sandbox>
Implementation of Sandbox for Box<dyn Sandbox>.
This allows using trait objects with generic sandbox validators.
impl Sandbox for Box<dyn Sandbox>
Implementation of Sandbox for Box<dyn Sandbox>.
This allows using trait objects with generic sandbox validators.