pub enum PrivilegeMode {
Unprivileged,
Privileged,
Auto,
}Expand description
Determines how the sandbox operates with respect to privileges
Variants§
Unprivileged
Use only unprivileged mechanisms: user namespaces + seccomp + landlock + setrlimit. Does NOT require root. Fails if essential unprivileged features are unavailable.
Privileged
Use all available mechanisms including privileged ones: all namespaces + cgroups + chroot + seccomp. Requires root. Fails if not running as root.
Auto
Automatically detect the best available mode. Uses privileged mode if running as root, otherwise falls back to unprivileged.
Implementations§
Source§impl PrivilegeMode
impl PrivilegeMode
Sourcepub fn resolve(&self, caps: &SystemCapabilities) -> ResolvedMode
pub fn resolve(&self, caps: &SystemCapabilities) -> ResolvedMode
Resolve Auto mode to a concrete mode based on system capabilities
Trait Implementations§
Source§impl Clone for PrivilegeMode
impl Clone for PrivilegeMode
Source§fn clone(&self) -> PrivilegeMode
fn clone(&self) -> PrivilegeMode
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 PrivilegeMode
impl Debug for PrivilegeMode
Source§impl Default for PrivilegeMode
impl Default for PrivilegeMode
Source§fn default() -> PrivilegeMode
fn default() -> PrivilegeMode
Returns the “default value” for a type. Read more
Source§impl PartialEq for PrivilegeMode
impl PartialEq for PrivilegeMode
impl Copy for PrivilegeMode
impl Eq for PrivilegeMode
impl StructuralPartialEq for PrivilegeMode
Auto Trait Implementations§
impl Freeze for PrivilegeMode
impl RefUnwindSafe for PrivilegeMode
impl Send for PrivilegeMode
impl Sync for PrivilegeMode
impl Unpin for PrivilegeMode
impl UnsafeUnpin for PrivilegeMode
impl UnwindSafe for PrivilegeMode
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