pub struct Capability {
pub level: u32,
pub description: String,
}Expand description
A capability token representing a permission level for IO operations.
Fields§
§level: u32The permission level (higher = more privileged).
description: StringHuman-readable description.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn read_write() -> Self
pub fn read_write() -> Self
Read-write capability.
Sourcepub fn is_sufficient_for(&self, required: u32) -> bool
pub fn is_sufficient_for(&self, required: u32) -> bool
Check if this capability is sufficient for the required level.
Sourcepub fn attenuate(&self, max_level: u32) -> Capability
pub fn attenuate(&self, max_level: u32) -> Capability
Attenuate (reduce) the capability to a lower level.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
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 Capability
impl Debug for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
impl Eq for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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