pub struct GrantSet(/* private fields */);Expand description
A set of permissions.
Unordered and duplicate-free by construction, so equal permissions always produce an equal digest regardless of how the set was built.
Implementations§
Source§impl GrantSet
impl GrantSet
Sourcepub fn new(atoms: impl IntoIterator<Item = GrantAtom>) -> Self
pub fn new(atoms: impl IntoIterator<Item = GrantAtom>) -> Self
Build a set from atoms, discarding duplicates.
Sourcepub fn parse<'a>(
atoms: impl IntoIterator<Item = &'a str>,
) -> Result<Self, GrantAtomParseError>
pub fn parse<'a>( atoms: impl IntoIterator<Item = &'a str>, ) -> Result<Self, GrantAtomParseError>
Sourcepub fn iter(&self) -> impl Iterator<Item = &GrantAtom>
pub fn iter(&self) -> impl Iterator<Item = &GrantAtom>
Iterate the atoms in a deterministic order.
Sourcepub fn contains_atom(&self, atom: &GrantAtom) -> bool
pub fn contains_atom(&self, atom: &GrantAtom) -> bool
Whether this set contains exactly this atom.
This is literal membership, not the containment relation ⊑ — an
atom may be permitted by a broader atom in the set without appearing in
it. That question belongs to the grant lattice.
Sourcepub fn has_templates(&self) -> bool
pub fn has_templates(&self) -> bool
Whether any atom carries an unresolved template.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GrantSet
impl<'de> Deserialize<'de> for GrantSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GrantSet
Source§impl FromIterator<GrantAtom> for GrantSet
impl FromIterator<GrantAtom> for GrantSet
Source§impl<'a> IntoIterator for &'a GrantSet
impl<'a> IntoIterator for &'a GrantSet
Source§impl Ord for GrantSet
impl Ord for GrantSet
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for GrantSet
impl PartialOrd for GrantSet
impl StructuralPartialEq for GrantSet
Auto Trait Implementations§
impl Freeze for GrantSet
impl RefUnwindSafe for GrantSet
impl Send for GrantSet
impl Sync for GrantSet
impl Unpin for GrantSet
impl UnsafeUnpin for GrantSet
impl UnwindSafe for GrantSet
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> Canonical for T
impl<T> Canonical for T
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, CanonicalError>
fn canonical_bytes(&self) -> Result<Vec<u8>, CanonicalError>
The canonical CBOR encoding of this value.