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.
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.
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 Clone for Permissions
impl Clone for Permissions
Source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Permissions
Source§impl Debug for Permissions
impl Debug for Permissions
Source§impl Default for Permissions
impl Default for Permissions
Source§fn default() -> Permissions
fn default() -> 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 PartialEq for Permissions
impl PartialEq for Permissions
Source§impl Serialize for Permissions
impl Serialize for Permissions
impl StructuralPartialEq for Permissions
Auto Trait Implementations§
impl Freeze 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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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