pub struct Role {
pub role_id: String,
pub name: String,
pub position: u32,
pub permissions: Permissions,
pub scope: RoleScope,
pub color: u32,
pub rank: Option<String>,
pub display: bool,
pub mentionable: bool,
pub extra: Map<String, Value>,
}Expand description
A role: its own addressable RoleMetadata event (vsk=1). Fully general; the MVP
auto-creates exactly one (Role::admin).
Fields§
§role_id: StringRandom opaque 32-byte hex id, stable across renames; also the event’s d-tag.
name: String§position: u32Lower = higher authority. Owner is the implicit top (position 0, never a Role). Authoritative ordering will move to a single RoleOrder entity when drag-reorder ships; until then this declared value is the position (no reordering to race in the owner-only MVP).
permissions: Permissions§scope: RoleScope§color: u32UI badge color (e.g. the Admin crown); 0 = theme default. Cosmetic.
rank: Option<String>The Roles v2 rank key (CORD-04 §3), from which position is assigned at fold time.
None for a legacy Role, whose position is its own.
display: boolHolders list under this Role’s own heading.
mentionable: boolAny member may @mention it (CORD-03 §3).
extra: Map<String, Value>Fields another client wrote that this one doesn’t model. An edition replaces the whole entity, so they ride every republish untouched (CORD-02 §6): dropping them would erase another client’s data for every member.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
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 Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Forget for Role
impl Freeze for Role
impl Move for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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