Skip to content

Struct permissions::Resolved

zaun_community_protocol::permissions::Resolved · Struct

pub struct Resolved { … }

One resolved permission set (cp or chp).

The effective permissions after step 7. Always a subset of KNOWN.

The grants of steps 1–6 (after dependencies), before any restriction.

The permissions after steps 7a–7b but before the lockdown (7c) and the locked flag (7d). H3 for lockdown management compares against this, so a lockdown never prevents its own management.

What each restriction removed.

Whether step 7a applied.

Whether the waiting period applied.

pub fn unrestricted(p: Permissions) -> Self

A result with no restriction (owner, or a member the state gate zeroes).

pub const fn has(&self, bits: Permissions) -> bool

Whether every bit of bits is effective.

pub fn require(&self, bits: Permissions) -> Result<(), Denial>

Ok when every bit of bits is effective, else a denial naming the missing bits.

pub fn require_any(&self, bits: Permissions) -> Result<(), Denial>

Ok when at least one bit of bits is effective (or bits is empty).

pub fn explain(&self, missing: Permissions) -> Denial

Attributes missing bits to a restriction. A reason is given only when the restrictions are the whole cause (every missing bit was granted); then it names the first step, in order 7a–7d, that removed one of them or its prerequisite.

Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

Full rustdoc page