pub struct Workspace {
pub pipes: Pipes,
/* private fields */
}Expand description
Temporary workspace for sandbox execution.
Fields§
§pipes: PipesImplementations§
Source§impl Workspace
impl Workspace
pub fn new() -> Result<Self>
pub fn with_prefix(prefix: &str) -> Result<Self>
pub fn root(&self) -> &Path
pub fn write_file( &self, path: &str, content: &[u8], executable: bool, ) -> Result<PathBuf>
pub fn create_dir(&self, path: &str) -> Result<PathBuf>
pub fn setup_sandbox_dirs(&self) -> Result<()>
Sourcepub fn setup_minimal_etc(&self) -> Result<()>
pub fn setup_minimal_etc(&self) -> Result<()>
Create minimal /etc files to prevent information leakage.
Instead of mounting the host’s /etc (which contains sensitive info like /etc/passwd, /etc/shadow), we create a minimal /etc with only essential files.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl UnwindSafe for Workspace
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