pub struct Permissions(pub u64);Expand description
Management/moderation permission bits. Access (read/post a channel) is NOT here — that is key possession (the two-mechanism split). Bit positions are part of the wire format and are FROZEN: append a reserved bit, never renumber or reuse one.
Tuple Fields§
§0: u64Implementations§
Source§impl Permissions
impl Permissions
pub const MANAGE_ROLES: u64
pub const MANAGE_CHANNELS: u64
pub const MANAGE_METADATA: u64
pub const KICK: u64
pub const BAN: u64
pub const MANAGE_MESSAGES: u64
pub const CREATE_INVITE: u64
pub const VIEW_AUDIT_LOG: u64
pub const MENTION_EVERYONE: u64
Sourcepub const PIN_MESSAGES: u64
pub const PIN_MESSAGES: u64
Curate a Channel’s Pin List (CORD-04 §7) — editorial power: a pin makes its message permanently attributable to every future member.
pub const VIEW_CHANNEL: u64
pub const SEND_MESSAGES: u64
pub const SEND_IN_THREADS: u64
pub const ATTACH_FILES: u64
pub const ADD_REACTIONS: u64
pub const READ_MESSAGE_HISTORY: u64
pub const CONNECT: u64
pub const SPEAK: u64
pub const VIDEO: u64
pub const PRIORITY_SPEAKER: u64
pub const MUTE_MEMBERS: u64
pub const DEAFEN_MEMBERS: u64
pub const MOVE_MEMBERS: u64
Sourcepub const MODERATE_MEMBERS: u64
pub const MODERATE_MEMBERS: u64
Timeouts (CORD-04 §6).
Sourcepub const MANAGE_NICKNAMES: u64
pub const MANAGE_NICKNAMES: u64
Name members beneath them (CORD-04 §10).
Sourcepub const CHANGE_NICKNAME: u64
pub const CHANGE_NICKNAME: u64
Name themselves (CORD-04 §10).
Sourcepub const ADMIN_FOUNDING_MASK: u64
pub const ADMIN_FOUNDING_MASK: u64
The founding nine bits — the mask every Admin role published before PIN_MESSAGES existed carries. FROZEN FOREVER: this is the floor the admin-role finder tests with, so it must never gain a bit. Widening it would orphan every published Admin role and mint duplicates.
Sourcepub const ADMIN_ALL: u64
pub const ADMIN_ALL: u64
Every management bit currently defined — what a newly minted “Admin”
role holds. MAY widen as bits land; anything that identifies an
existing admin role must test Self::ADMIN_FOUNDING_MASK instead.
Sourcepub const MANAGEMENT_MASK: u64
pub const MANAGEMENT_MASK: u64
Control-plane bits: exercising any of these signs a control/metadata edition (keyless model —
the actor’s own npub signature IS the authority, re-verified against the roster). Every
management bit EXCEPT purely-social ones (MENTION_EVERYONE acts at the message layer, not the
control plane). A role with any of these is a “management role” — its holder shows the admin crown.
Sourcepub const STAFF_MASK: u64
pub const STAFF_MASK: u64
The STAFF bits (CORD-04 §3): the permissions whose authorized actions
land as Control Plane editions. A member holding ANY of them — plus
always the owner — is staff: the set that holds the control_root
write key (CORD-02 §2). KICK writes to the Guestbook and
MANAGE_MESSAGES to Chat planes; neither needs it. The list is
normative — a future permission whose actions are Control editions
joins it by explicit spec amendment, never by local judgment.
pub fn empty() -> Self
pub fn admin() -> Self
Sourcepub fn is_management(self) -> bool
pub fn is_management(self) -> bool
True iff this role carries any management permission (vs. a purely-social role) — i.e. its holder counts as an admin.
pub fn union(self, other: Permissions) -> Permissions
Trait Implementations§
Source§impl BitOr for Permissions
impl BitOr for Permissions
Source§type Output = Permissions
type Output = Permissions
| operator.Source§fn bitor(self, rhs: Permissions) -> Permissions
fn bitor(self, rhs: Permissions) -> Permissions
| operation. Read moreSource§impl Clone for Permissions
impl Clone for Permissions
impl Copy for Permissions
Source§impl Debug for Permissions
impl Debug for Permissions
Source§impl Default for Permissions
impl Default for Permissions
Source§impl<'de> Deserialize<'de> for Permissions
impl<'de> Deserialize<'de> for Permissions
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>,
impl Eq for Permissions
Source§impl From<u64> for Permissions
The bit constants are plain u64s, so Permissions::KICK | Permissions::BAN converts.
impl From<u64> for Permissions
The bit constants are plain u64s, so Permissions::KICK | Permissions::BAN converts.
Source§impl PartialEq for Permissions
impl PartialEq for Permissions
Source§impl Serialize for Permissions
impl Serialize for Permissions
impl StructuralPartialEq for Permissions
Auto Trait Implementations§
impl Forget for Permissions
impl Freeze for Permissions
impl Move for Permissions
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnsafeUnpin for Permissions
impl UnwindSafe for Permissions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more