pub struct CapToken { /* private fields */ }Expand description
An unforgeable capability token.
Capability tokens are the sole mechanism for accessing RVM resources. They are created by the kernel and cannot be forged by partitions.
Implementations§
Source§impl CapToken
impl CapToken
Sourcepub const fn new(
id: u64,
cap_type: CapType,
rights: CapRights,
epoch: u32,
) -> Self
pub const fn new( id: u64, cap_type: CapType, rights: CapRights, epoch: u32, ) -> Self
Create a new capability token.
Sourcepub const fn has_rights(self, required: CapRights) -> bool
pub const fn has_rights(self, required: CapRights) -> bool
Check whether this token carries the given rights.
Sourcepub const fn truncated_hash(self) -> u32
pub const fn truncated_hash(self) -> u32
Return a truncated 32-bit hash for witness record embedding.
This is NOT the full capability – it is a truncated hash used for identification without leaking the full token contents.
Trait Implementations§
impl Copy for CapToken
impl Eq for CapToken
impl StructuralPartialEq for CapToken
Auto Trait Implementations§
impl Freeze for CapToken
impl RefUnwindSafe for CapToken
impl Send for CapToken
impl Sync for CapToken
impl Unpin for CapToken
impl UnsafeUnpin for CapToken
impl UnwindSafe for CapToken
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