pub struct SystemCapabilities {
pub has_root: bool,
pub has_user_namespaces: bool,
pub has_seccomp: bool,
pub has_landlock: bool,
pub has_cgroup_v2: bool,
pub has_cgroup_delegation: bool,
}Expand description
Detected system capabilities for sandboxing
Fields§
§has_root: boolRunning as root (euid == 0)
has_user_namespaces: boolUnprivileged user namespaces are available
has_seccomp: boolSeccomp BPF filtering is available
has_landlock: boolLandlock LSM is available (Linux 5.13+)
has_cgroup_v2: boolCgroup v2 unified hierarchy is mounted
has_cgroup_delegation: boolCgroup delegation is available for current user
Implementations§
Source§impl SystemCapabilities
impl SystemCapabilities
Sourcepub fn detect() -> SystemCapabilities
pub fn detect() -> SystemCapabilities
Detect all available capabilities on the current system
Sourcepub fn can_sandbox_unprivileged(&self) -> bool
pub fn can_sandbox_unprivileged(&self) -> bool
Check if unprivileged sandboxing is possible (without root)
Sourcepub fn can_sandbox_privileged(&self) -> bool
pub fn can_sandbox_privileged(&self) -> bool
Check if full privileged sandboxing is possible
Trait Implementations§
Source§impl Clone for SystemCapabilities
impl Clone for SystemCapabilities
Source§fn clone(&self) -> SystemCapabilities
fn clone(&self) -> SystemCapabilities
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 moreAuto Trait Implementations§
impl Freeze for SystemCapabilities
impl RefUnwindSafe for SystemCapabilities
impl Send for SystemCapabilities
impl Sync for SystemCapabilities
impl Unpin for SystemCapabilities
impl UnsafeUnpin for SystemCapabilities
impl UnwindSafe for SystemCapabilities
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