pub struct CapabilitySet(/* private fields */);Expand description
An unordered set of capability strings held by a token.
Access control is pure set membership with a single special case: the
WILDCARD string satisfies any required capability.
Implementations§
Source§impl CapabilitySet
impl CapabilitySet
Sourcepub fn wildcard() -> Self
pub fn wildcard() -> Self
Create a wildcard set — satisfies every capability check.
This is the set held by the full-control preset and the legacy-key
mapping target (spec §4).
Sourcepub fn satisfies(&self, required: &str) -> bool
pub fn satisfies(&self, required: &str) -> bool
Whether this set satisfies required — either it holds the wildcard,
or it directly contains the required capability string.
This is the frozen access-decision primitive (spec §2.1).
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Whether this set holds the wildcard capability.
Trait Implementations§
Source§impl Clone for CapabilitySet
impl Clone for CapabilitySet
Source§fn clone(&self) -> CapabilitySet
fn clone(&self) -> CapabilitySet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CapabilitySet
impl Debug for CapabilitySet
Source§impl Default for CapabilitySet
impl Default for CapabilitySet
Source§fn default() -> CapabilitySet
fn default() -> CapabilitySet
Returns the “default value” for a type. Read more
impl Eq for CapabilitySet
Source§impl<S: Into<String>> FromIterator<S> for CapabilitySet
impl<S: Into<String>> FromIterator<S> for CapabilitySet
Source§fn from_iter<I: IntoIterator<Item = S>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = S>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl PartialEq for CapabilitySet
impl PartialEq for CapabilitySet
impl StructuralPartialEq for CapabilitySet
Auto Trait Implementations§
impl Freeze for CapabilitySet
impl RefUnwindSafe for CapabilitySet
impl Send for CapabilitySet
impl Sync for CapabilitySet
impl Unpin for CapabilitySet
impl UnsafeUnpin for CapabilitySet
impl UnwindSafe for CapabilitySet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.