pub struct CapabilitySet(/* private fields */);Expand description
A set of Capabilitys. Small, Copy, and closed under the usual set
algebra — the decision engine works only through these operations.
Implementations§
Source§impl CapabilitySet
impl CapabilitySet
Sourcepub const fn all() -> Self
pub const fn all() -> Self
The full privileged set — every member of the taxonomy. This is the fail-closed requirement for an unclassifiable tool.
Sourcepub const fn of(capability: Capability) -> Self
pub const fn of(capability: Capability) -> Self
The set containing exactly capability.
Sourcepub const fn with(self, capability: Capability) -> Self
pub const fn with(self, capability: Capability) -> Self
This set plus capability.
Sourcepub const fn contains(self, capability: Capability) -> bool
pub const fn contains(self, capability: Capability) -> bool
Whether capability is in this set.
Sourcepub const fn is_subset_of(self, other: Self) -> bool
pub const fn is_subset_of(self, other: Self) -> bool
Whether every member of this set is also in other.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Set intersection.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Set difference: the members of this set that are not in other.
Sourcepub fn iter(self) -> impl Iterator<Item = Capability>
pub fn iter(self) -> impl Iterator<Item = Capability>
The members of this set, in Capability::ALL order.
Sourcepub fn from_names<'a, I: IntoIterator<Item = &'a str>>(
names: I,
) -> (Self, Vec<String>)
pub fn from_names<'a, I: IntoIterator<Item = &'a str>>( names: I, ) -> (Self, Vec<String>)
Build a set from stable kebab-case names (e.g. an Agent custom resource’s taint-resilient list or the harness wire). Unrecognized names are NOT granted — they are returned separately so the caller can log them — which is the fail-closed direction: a typo in operator config grants nothing rather than something unintended.
Sourcepub fn names(self) -> Vec<&'static str>
pub fn names(self) -> Vec<&'static str>
The stable kebab-case names of this set’s members, in
Capability::ALL order — the inverse of Self::from_names.
Trait Implementations§
Source§impl Clone for CapabilitySet
impl Clone for CapabilitySet
Source§fn clone(&self) -> CapabilitySet
fn clone(&self) -> CapabilitySet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CapabilitySet
Source§impl Debug for CapabilitySet
impl Debug for CapabilitySet
Source§impl Default for CapabilitySet
impl Default for CapabilitySet
Source§fn default() -> CapabilitySet
fn default() -> CapabilitySet
impl Eq for CapabilitySet
Source§impl FromIterator<Capability> for CapabilitySet
impl FromIterator<Capability> for CapabilitySet
Source§fn from_iter<I: IntoIterator<Item = Capability>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Capability>>(iter: I) -> Self
Source§impl Hash for CapabilitySet
impl Hash for CapabilitySet
Source§impl PartialEq for CapabilitySet
impl PartialEq for CapabilitySet
Source§fn eq(&self, other: &CapabilitySet) -> bool
fn eq(&self, other: &CapabilitySet) -> bool
self and other values to be equal, and is used by ==.