pub struct Sandbox { /* private fields */ }Expand description
Executes modules in an isolated subprocess for security isolation.
When enabled is false, execution is performed in-process (no sandbox).
When enabled is true, a child process running _sandbox_runner handles
the execution and communicates results via JSON over stdin/stdout.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn new(enabled: bool, timeout_ms: u64) -> Self
pub fn new(enabled: bool, timeout_ms: u64) -> Self
Create a new Sandbox.
§Arguments
enabled— enable subprocess isolationtimeout_ms— subprocess timeout in milliseconds (0 = use default 300 s)
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Return true when subprocess isolation is enabled.
Auto Trait Implementations§
impl Freeze for Sandbox
impl RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
impl UnwindSafe for Sandbox
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