pub struct SandboxState {
pub fs: Vec<FsCapState>,
pub net_blocked: bool,
}Expand description
Serializable representation of sandbox state
Fields§
§fs: Vec<FsCapState>Filesystem capabilities
net_blocked: boolWhether network is blocked
Implementations§
Source§impl SandboxState
impl SandboxState
Sourcepub fn from_caps(caps: &CapabilitySet) -> Self
pub fn from_caps(caps: &CapabilitySet) -> Self
Create state from a capability set
Sourcepub fn to_caps(&self) -> Result<CapabilitySet>
pub fn to_caps(&self) -> Result<CapabilitySet>
Convert state back to a capability set
Paths are re-validated through the standard constructors (new_dir/new_file)
which canonicalize paths and verify existence. This prevents crafted JSON from
injecting arbitrary paths that bypass validation.
Returns an error if any path no longer exists or fails validation.
Trait Implementations§
Source§impl Clone for SandboxState
impl Clone for SandboxState
Source§fn clone(&self) -> SandboxState
fn clone(&self) -> SandboxState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SandboxState
impl Debug for SandboxState
Source§impl<'de> Deserialize<'de> for SandboxState
impl<'de> Deserialize<'de> for SandboxState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SandboxState
impl RefUnwindSafe for SandboxState
impl Send for SandboxState
impl Sync for SandboxState
impl Unpin for SandboxState
impl UnsafeUnpin for SandboxState
impl UnwindSafe for SandboxState
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