pub struct SandboxCommand { /* private fields */ }Expand description
A command builder with the familiar Command interface plus sandbox mount
controls. Output handling is deliberately left to the caller.
Implementations§
Source§impl SandboxCommand
impl SandboxCommand
Sourcepub fn initialize() -> Result<(), SandboxCommandError>
pub fn initialize() -> Result<(), SandboxCommandError>
Verify that the platform sandbox is available. Call this during application startup; the result is cached for later commands.
pub fn new(program: impl AsRef<OsStr>) -> Self
pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut Self
pub fn args<I, S>(&mut self, args: I) -> &mut Self
pub fn env( &mut self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>, ) -> &mut Self
pub fn envs<I, K, V>(&mut self, envs: I) -> &mut Self
pub fn env_remove(&mut self, key: impl AsRef<OsStr>) -> &mut Self
pub fn env_clear(&mut self) -> &mut Self
pub fn current_dir(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn stdin(&mut self, cfg: Stdio) -> &mut Self
pub fn stdout(&mut self, cfg: Stdio) -> &mut Self
pub fn stderr(&mut self, cfg: Stdio) -> &mut Self
pub fn kill_on_drop(&mut self, kill: bool) -> &mut Self
Sourcepub fn bind_rw(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn bind_rw(&mut self, path: impl Into<PathBuf>) -> &mut Self
Add a writable path at the same location inside the sandbox.
Sourcepub fn bind_ro(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn bind_ro(&mut self, path: impl Into<PathBuf>) -> &mut Self
Add a read-only path at the same location inside the sandbox.
pub fn spawn(&mut self) -> Result<SandboxChild, SandboxCommandError>
Auto Trait Implementations§
impl Freeze for SandboxCommand
impl RefUnwindSafe for SandboxCommand
impl Send for SandboxCommand
impl Sync for SandboxCommand
impl Unpin for SandboxCommand
impl UnsafeUnpin for SandboxCommand
impl UnwindSafe for SandboxCommand
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