pub struct Ops(/* private fields */);Expand description
The operations a capability grants — a bitset of read / write / compute.
Implementations§
Source§impl Ops
impl Ops
pub const NONE: Ops
pub const READ: Ops
pub const WRITE: Ops
pub const COMPUTE: Ops
Sourcepub fn contains(self, needed: Ops) -> bool
pub fn contains(self, needed: Ops) -> bool
Whether self grants every op in needed (and needed is non-empty).
pub fn is_empty(self) -> bool
Sourcepub fn is_subset_of(self, other: Ops) -> bool
pub fn is_subset_of(self, other: Ops) -> bool
Whether self is a subset of other — used to check a sub-grant doesn’t
escalate ops beyond its parent (S2).
Trait Implementations§
impl Copy for Ops
Source§impl<'de> Deserialize<'de> for Ops
impl<'de> Deserialize<'de> for Ops
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Ops, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Ops, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Ops
Source§impl Serialize for Ops
impl Serialize for Ops
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Ops
Auto Trait Implementations§
impl Freeze for Ops
impl RefUnwindSafe for Ops
impl Send for Ops
impl Sync for Ops
impl Unpin for Ops
impl UnsafeUnpin for Ops
impl UnwindSafe for Ops
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