pub struct Sandbox {
pub mode: SandboxMode,
pub policy: SandboxPolicy,
pub capabilities: SandboxCapabilities,
}Expand description
Global sandbox configuration and state.
Fields§
§mode: SandboxMode§policy: SandboxPolicy§capabilities: SandboxCapabilitiesImplementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn new(policy: SandboxPolicy) -> Self
pub fn new(policy: SandboxPolicy) -> Self
Create a new sandbox with auto-detection.
Sourcepub fn with_mode(mode: SandboxMode, policy: SandboxPolicy) -> Self
pub fn with_mode(mode: SandboxMode, policy: SandboxPolicy) -> Self
Create a sandbox with a specific mode.
Sourcepub fn effective_mode(&self) -> SandboxMode
pub fn effective_mode(&self) -> SandboxMode
Get the effective mode (resolving Auto).
Sourcepub fn check_path(&self, path: &Path) -> Result<(), String>
pub fn check_path(&self, path: &Path) -> Result<(), String>
Check if a path is accessible under the current policy.
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