pub struct Capability { /* private fields */ }Expand description
Sealed capability with HMAC signature
Corresponds to Lean: structure Capability
SECURITY: All fields are pub(crate) to prevent forgery. Capabilities can only be created through kernel operations.
IMPORTANT: signature is RuntimeTag (opaque), NOT SymbolicTag. This prevents key leakage when comparing plugin states.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn new(
id: u128,
holder: u128,
target: u128,
rights: Rights,
parent: Option<u128>,
epoch: u64,
signature: SealedTag,
) -> Result<Capability, CapabilityError>
pub fn new( id: u128, holder: u128, target: u128, rights: Rights, parent: Option<u128>, epoch: u64, signature: SealedTag, ) -> Result<Capability, CapabilityError>
Create a new capability (kernel-only operation)
Returns Err if invariants violated.
Corresponds to Lean: Capability.WellFormed requirements:
- h_holder_valid: holder > 0
- h_rights_nonempty: rights != {}
Sourcepub fn payload(&self) -> CapPayload
pub fn payload(&self) -> CapPayload
Extract payload for verification
Corresponds to Lean: def Capability.payload
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 (const: unstable) · 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
impl Eq for Capability
Source§impl PartialEq for Capability
impl PartialEq 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