pub struct ExecRequest {
pub language: Language,
pub code: String,
pub stdin: Option<String>,
pub timeout: Duration,
pub memory_limit_mb: Option<u32>,
pub env: HashMap<String, String>,
}Available on crate feature
sandbox only.Expand description
A request to execute code in a sandbox.
ExecRequest intentionally has no Default implementation — callers must
explicitly set the timeout to avoid unbounded execution.
§Example
use adk_sandbox::{ExecRequest, Language};
use std::time::Duration;
use std::collections::HashMap;
let request = ExecRequest {
language: Language::Python,
code: "print('hello')".to_string(),
stdin: None,
timeout: Duration::from_secs(30),
memory_limit_mb: None,
env: HashMap::new(),
};Fields§
§language: LanguageThe language of the code to execute.
code: StringThe source code or command to execute.
stdin: Option<String>Optional standard input to feed to the process.
timeout: DurationMaximum wall-clock time allowed for execution. No default — must be set explicitly.
memory_limit_mb: Option<u32>Optional memory limit in megabytes. Only enforced by WasmBackend.
env: HashMap<String, String>Environment variables passed to the child process. The backend clears the inherited environment and sets only these variables.
Trait Implementations§
Source§impl Clone for ExecRequest
impl Clone for ExecRequest
Source§fn clone(&self) -> ExecRequest
fn clone(&self) -> ExecRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExecRequest
impl RefUnwindSafe for ExecRequest
impl Send for ExecRequest
impl Sync for ExecRequest
impl Unpin for ExecRequest
impl UnsafeUnpin for ExecRequest
impl UnwindSafe for ExecRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more