Skip to main content

CapRights

Struct CapRights 

Source
pub struct CapRights(/* private fields */);
Expand description

Capability rights bitmap.

Rights determine what operations are permitted on the capability’s target object. Rights are checked at syscall time and cannot be escalated.

Implementations§

Source§

impl CapRights

Source

pub const READ: Self

Right to read from the object (e.g., vector_get, queue_recv).

Source

pub const WRITE: Self

Right to write to the object (e.g., queue_send, region writes).

Source

pub const GRANT: Self

Right to grant this capability to other tasks via cap_grant.

Source

pub const REVOKE: Self

Right to revoke capabilities derived from this one.

Source

pub const EXECUTE: Self

Right to execute (e.g., task entry point, RVF component).

Source

pub const PROVE: Self

Right to generate proof tokens for this object. Required for vector_put_proved and graph_apply_proved.

Source

pub const GRANT_ONCE: Self

Non-transitive grant right (cannot be further delegated). See Section 20.2 of ADR-087.

Source

pub const NONE: Self

No rights.

Source

pub const ALL: Self

All rights.

Source

pub const fn from_bits(bits: u32) -> Self

Creates a new CapRights from a raw value.

Source

pub const fn bits(&self) -> u32

Returns the raw bits.

Source

pub const fn is_empty(&self) -> bool

Checks if no rights are set.

Source

pub const fn contains(&self, other: Self) -> bool

Checks if all specified rights are set.

Source

pub const fn union(self, other: Self) -> Self

Returns the union of two rights sets.

Source

pub const fn intersection(self, other: Self) -> Self

Returns the intersection of two rights sets.

Source

pub const fn difference(self, other: Self) -> Self

Returns the difference (rights in self but not in other).

Source

pub const fn is_subset_of(&self, other: Self) -> bool

Checks if this rights set is a subset of another (can be derived from it).

Trait Implementations§

Source§

impl BitAnd for CapRights

Source§

type Output = CapRights

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign for CapRights

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for CapRights

Source§

type Output = CapRights

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign for CapRights

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl Clone for CapRights

Source§

fn clone(&self) -> CapRights

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CapRights

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CapRights

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Hash for CapRights

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CapRights

Source§

fn eq(&self, other: &CapRights) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CapRights

Source§

impl Eq for CapRights

Source§

impl StructuralPartialEq for CapRights

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.