pub struct Sandbox { /* private fields */ }Expand description
Active sandbox
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if sandbox is running
Sourcepub fn run(&mut self, program: &str, args: &[&str]) -> Result<SandboxResult>
pub fn run(&mut self, program: &str, args: &[&str]) -> Result<SandboxResult>
Run program in sandbox
Sourcepub fn run_with_stream(
&mut self,
program: &str,
args: &[&str],
) -> Result<(SandboxResult, ProcessStream)>
pub fn run_with_stream( &mut self, program: &str, args: &[&str], ) -> Result<(SandboxResult, ProcessStream)>
Run program with streaming output
pub fn kill(&mut self) -> Result<()>
Sourcepub fn get_resource_usage(&self) -> Result<(u64, u64)>
pub fn get_resource_usage(&self) -> Result<(u64, u64)>
Get resource usage
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sandbox
impl RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin 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