pub struct CapabilityManager { /* private fields */ }Expand description
Security context that tracks capability state
Implementations§
Source§impl CapabilityManager
impl CapabilityManager
pub fn new() -> Self
Sourcepub fn drop_all(&mut self) -> Result<()>
pub fn drop_all(&mut self) -> Result<()>
Drop all capabilities
This implements the transition: Privileged -> CapabilitiesDropped in the security state machine (Nucleus_Security_SecurityEnforcement.tla)
Sourcepub fn drop_except(&mut self, keep: &[Capability]) -> Result<()>
pub fn drop_except(&mut self, keep: &[Capability]) -> Result<()>
Drop all capabilities except the specified ones
For most use cases, we drop ALL capabilities. This method is provided for special cases where specific capabilities are needed.
Sourcepub fn apply_sets(&mut self, sets: &CapabilitySets) -> Result<()>
pub fn apply_sets(&mut self, sets: &CapabilitySets) -> Result<()>
Apply explicit capability sets.
Bounding is handled as a drop-only upper bound; the remaining sets are set exactly to the provided values.
Sourcepub fn is_dropped(&self) -> bool
pub fn is_dropped(&self) -> bool
Check if capabilities have been dropped
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CapabilityManager
impl RefUnwindSafe for CapabilityManager
impl Send for CapabilityManager
impl Sync for CapabilityManager
impl Unpin for CapabilityManager
impl UnsafeUnpin for CapabilityManager
impl UnwindSafe for CapabilityManager
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