pub struct GrantSet(/* private fields */);Expand description
A validated set of grants (§5.1). Construction through
GrantSet::from_names is the shared validator.
Implementations§
Source§impl GrantSet
impl GrantSet
Sourcepub fn from_names(names: &[&str]) -> Result<Self, GrantError>
pub fn from_names(names: &[&str]) -> Result<Self, GrantError>
Builds a grant set from wire names, enforcing both §5.1 rules:
every name must be in the closed set, and every veto:* must be
accompanied by its matching observe:*.
Sourcepub fn from_grants(grants: impl IntoIterator<Item = Grant>) -> Self
pub fn from_grants(grants: impl IntoIterator<Item = Grant>) -> Self
A set from already-validated grants (no re-validation; used where the grants were constructed as typed values).
pub fn contains(&self, grant: Grant) -> bool
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = Grant> + '_
Sourcepub fn observes_class(&self, class: HookClass) -> bool
pub fn observes_class(&self, class: HookClass) -> bool
Whether the set’s observe:* coverage includes class (§5.2’s
boot check: every subscribed hook must be covered).
Trait Implementations§
impl Eq for GrantSet
Source§impl IntoIterator for &GrantSet
impl IntoIterator for &GrantSet
impl StructuralPartialEq for GrantSet
Auto Trait Implementations§
impl Forget for GrantSet
impl Freeze for GrantSetwhere
*const LeafNode<Grant, SetValZST> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(Grant, SetValZST)>>: Freeze,
impl Move for GrantSet
impl RefUnwindSafe for GrantSet
impl Send for GrantSet
impl Sync for GrantSet
impl Unpin for GrantSet
impl UnsafeUnpin for GrantSetwhere
*const LeafNode<Grant, SetValZST> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(Grant, SetValZST)>>: UnsafeUnpin,
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