Struct permissions::Requirement
zaun_community_protocol::permissions::Requirement · Struct
pub struct Requirement { … }What a command requires (permissions the protocol, the protocol).
Fields
Section titled “Fields”access: Access
Section titled “access: Access”Who may send it.
scope: Scope
Section titled “scope: Scope”Where the bits are evaluated.
all: Permissions
Section titled “all: Permissions”Bits that must all be effective.
any: Permissions
Section titled “any: Permissions”When non-empty, at least one of these must be effective as well.
others: Option<Permissions>
Section titled “others: Option<Permissions>”When acting on another member’s object (message, reaction, nickname, invitation,
report), these bits replace all.
conditional: Permissions
Section titled “conditional: Permissions”Bits needed only for some bodies: the engine passes the ones that apply (attachments, links, a new emoji, a pre-approved invitation, a channel stream, a full record).
not_timed_out: bool
Section titled “not_timed_out: bool”Refused with TIMED_OUT while timed out, even when the bits survive the timeout.
not_waiting: bool
Section titled “not_waiting: bool”Refused with FORBIDDEN{reason:"probation"} during the waiting period.
reserved: bool
Section titled “reserved: bool”Reserved (P1/P2): a v1 host answers UNSUPPORTED_FEATURE before any check.
Methods
Section titled “Methods”access
Section titled “access”pub const fn access(access: Access) -> SelfA row with no bits.
pub const fn bits(scope: Scope, all: Permissions) -> SelfA member command needing all in scope.
pub fn check(&self, resolved: &Resolved, other: bool, conditional: Permissions) -> Result<(), Denial>Checks the resolved permissions in the requirement’s scope. other is true when the
actor acts on another member’s object; conditional holds the conditional bits the
body needs (masked by Requirement::conditional).
Trait implementations
Section titled “Trait implementations”Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq