pub struct CapSpaceModel { /* private fields */ }Expand description
Capability space model (per-process capability table)
Implementations§
Source§impl CapSpaceModel
impl CapSpaceModel
Sourcepub fn create_root(&mut self, rights: u32, owner: u64) -> CapabilityModel
pub fn create_root(&mut self, rights: u32, owner: u64) -> CapabilityModel
Create a root capability (only the kernel can do this)
Sourcepub fn derive(
&mut self,
parent_token: u64,
child_rights: u32,
child_owner: u64,
) -> Result<CapabilityModel, CapModelError>
pub fn derive( &mut self, parent_token: u64, child_rights: u32, child_owner: u64, ) -> Result<CapabilityModel, CapModelError>
Derive a child capability from a parent
Sourcepub fn revoke(&mut self, token: u64) -> Result<usize, CapModelError>
pub fn revoke(&mut self, token: u64) -> Result<usize, CapModelError>
Revoke a capability and all its descendants
Sourcepub fn lookup(&self, token: u64) -> Option<&CapabilityModel>
pub fn lookup(&self, token: u64) -> Option<&CapabilityModel>
Look up a capability by token
Sourcepub fn validate(
&self,
token: u64,
expected_gen: u32,
) -> Result<&CapabilityModel, CapModelError>
pub fn validate( &self, token: u64, expected_gen: u32, ) -> Result<&CapabilityModel, CapModelError>
Validate that a token is still valid (correct generation)
Sourcepub fn revocation_log(&self) -> &[u64]
pub fn revocation_log(&self) -> &[u64]
Get the revocation log
Trait Implementations§
Source§impl Clone for CapSpaceModel
impl Clone for CapSpaceModel
Source§fn clone(&self) -> CapSpaceModel
fn clone(&self) -> CapSpaceModel
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CapSpaceModel
impl Debug for CapSpaceModel
Source§impl Default for CapSpaceModel
impl Default for CapSpaceModel
Source§fn default() -> CapSpaceModel
fn default() -> CapSpaceModel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CapSpaceModel
impl RefUnwindSafe for CapSpaceModel
impl Send for CapSpaceModel
impl Sync for CapSpaceModel
impl Unpin for CapSpaceModel
impl UnwindSafe for CapSpaceModel
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)