Struct discord_flows::model::Role
source · pub struct Role {
pub id: RoleId,
pub guild_id: GuildId,
pub colour: u32,
pub hoist: bool,
pub managed: bool,
pub mentionable: bool,
pub name: String,
pub permissions: Permissions,
pub position: i64,
pub tags: RoleTags,
pub icon: Option<String>,
pub unicode_emoji: Option<String>,
}
Expand description
Information about a role within a guild. A role represents a set of permissions, and can be attached to one or multiple users. A role has various miscellaneous configurations, such as being assigned a colour. Roles are unique per guild and do not cross over to other guilds in any way, and can have channel-specific permission overrides in addition to guild-level permissions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: RoleId
The Id of the role. Can be used to calculate the role’s creation date.
guild_id: GuildId
The Id of the Guild the Role is in.
colour: u32
The colour of the role.
hoist: bool
Indicator of whether the role is pinned above lesser roles.
In the client, this causes Member
s in the role to be seen above
those in roles with a lower Self::position
.
managed: bool
Indicator of whether the role is managed by an integration service.
mentionable: bool
Indicator of whether the role can be mentioned, similar to mentioning a
specific member or @everyone
.
Only members of the role will be notified if a role is mentioned with
this set to true
.
name: String
The name of the role.
permissions: Permissions
A set of permissions that the role has been assigned.
See the permissions
module for more information.
position: i64
The role’s position in the position list. Roles are considered higher in hierarchy if their position is higher.
The @everyone
role is usually either -1
or 0
.
The tags this role has. It can be used to determine if this role is a special role in this guild
such as guild subscriber role, or if the role is linked to an Integration
or a bot.
icon: Option<String>
Role icon image hash.
role-icons/<role_id>/<hash>.png
- PNG, JPEG, WEBP
role-icons/<role_id>/a_<hash>.gif
- GIF, Animated WEBP
unicode_emoji: Option<String>
Role unicoded image.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Role, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Role, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl Mentionable for Role
impl Mentionable for Role
source§impl Ord for Role
impl Ord for Role
source§impl PartialEq<Role> for Role
impl PartialEq<Role> for Role
source§impl PartialOrd<Role> for Role
impl PartialOrd<Role> for Role
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more