Struct serenity::model::permissions::Permissions
[−]
pub struct Permissions { /* fields omitted */ }
A set of permissions that can be assigned to User
s and Role
s via
PermissionOverwrite
s, roles globally in a Guild
, and to
GuildChannel
s.
Methods
impl Permissions
const CREATE_INVITE: Permissions
CREATE_INVITE: Permissions = Permissions{bits: 1,}
Allows for the creation of RichInvite
s.
const KICK_MEMBERS: Permissions
KICK_MEMBERS: Permissions = Permissions{bits: 2,}
Allows for the kicking of guild members.
const BAN_MEMBERS: Permissions
BAN_MEMBERS: Permissions = Permissions{bits: 4,}
Allows the banning of guild members.
const ADMINISTRATOR: Permissions
ADMINISTRATOR: Permissions = Permissions{bits: 8,}
Allows all permissions, bypassing channel permission overwrites.
const MANAGE_CHANNELS: Permissions
MANAGE_CHANNELS: Permissions = Permissions{bits: 16,}
Allows management and editing of guild channels.
const MANAGE_GUILD: Permissions
MANAGE_GUILD: Permissions = Permissions{bits: 32,}
Allows management and editing of the guild.
const ADD_REACTIONS: Permissions
ADD_REACTIONS: Permissions = Permissions{bits: 64,}
Member
s with this permission can add new Reaction
s to a
Message
. Members can still react using reactions already added
to messages without this permission.
const READ_MESSAGES: Permissions
READ_MESSAGES: Permissions = Permissions{bits: 1024,}
Allows reading messages in a guild channel. If a user does not have this permission, then they will not be able to see the channel.
const SEND_MESSAGES: Permissions
SEND_MESSAGES: Permissions = Permissions{bits: 2048,}
Allows sending messages in a guild channel.
const SEND_TTS_MESSAGES: Permissions
SEND_TTS_MESSAGES: Permissions = Permissions{bits: 4096,}
Allows the sending of text-to-speech messages in a channel.
const MANAGE_MESSAGES: Permissions
MANAGE_MESSAGES: Permissions = Permissions{bits: 8192,}
Allows the deleting of other messages in a guild channel.
Note: This does not allow the editing of other messages.
const EMBED_LINKS: Permissions
EMBED_LINKS: Permissions = Permissions{bits: 16384,}
Allows links from this user - or users of this role - to be embedded, with potential data such as a thumbnail, description, and page name.
const ATTACH_FILES: Permissions
ATTACH_FILES: Permissions = Permissions{bits: 32768,}
Allows uploading of files.
const READ_MESSAGE_HISTORY: Permissions
READ_MESSAGE_HISTORY: Permissions = Permissions{bits: 65536,}
Allows the reading of a channel's message history.
const MENTION_EVERYONE: Permissions
MENTION_EVERYONE: Permissions = Permissions{bits: 131072,}
Allows the usage of the @everyone
mention, which will notify all
users in a channel. The @here
mention will also be available, and
can be used to mention all non-offline users.
Note: You probably want this to be disabled for most roles and users.
const USE_EXTERNAL_EMOJIS: Permissions
USE_EXTERNAL_EMOJIS: Permissions = Permissions{bits: 262144,}
Allows the usage of custom emojis from other guilds.
This does not dictate whether custom emojis in this guild can be used in other guilds.
const CONNECT: Permissions
CONNECT: Permissions = Permissions{bits: 1048576,}
Allows the joining of a voice channel.
const SPEAK: Permissions
SPEAK: Permissions = Permissions{bits: 2097152,}
Allows the user to speak in a voice channel.
const MUTE_MEMBERS: Permissions
MUTE_MEMBERS: Permissions = Permissions{bits: 4194304,}
Allows the muting of members in a voice channel.
const DEAFEN_MEMBERS: Permissions
DEAFEN_MEMBERS: Permissions = Permissions{bits: 8388608,}
Allows the deafening of members in a voice channel.
const MOVE_MEMBERS: Permissions
MOVE_MEMBERS: Permissions = Permissions{bits: 16777216,}
Allows the moving of members from one voice channel to another.
const USE_VAD: Permissions
USE_VAD: Permissions = Permissions{bits: 33554432,}
Allows the usage of voice-activity-detection in a voice channel.
If this is disabled, then Member
s must use push-to-talk.
const CHANGE_NICKNAME: Permissions
CHANGE_NICKNAME: Permissions = Permissions{bits: 67108864,}
Allows members to change their own nickname in the guild.
const MANAGE_NICKNAMES: Permissions
MANAGE_NICKNAMES: Permissions = Permissions{bits: 134217728,}
Allows members to change other members' nicknames.
const MANAGE_ROLES: Permissions
MANAGE_ROLES: Permissions = Permissions{bits: 268435456,}
Allows management and editing of roles below their own.
const MANAGE_WEBHOOKS: Permissions
MANAGE_WEBHOOKS: Permissions = Permissions{bits: 536870912,}
Allows management of webhooks.
const MANAGE_EMOJIS: Permissions
MANAGE_EMOJIS: Permissions = Permissions{bits: 1073741824,}
Allows management of emojis created without the use of an
Integration
.
fn empty() -> Permissions
Returns an empty set of flags.
fn all() -> Permissions
Returns the set containing all flags.
fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
fn from_bits(bits: u64) -> Option<Permissions>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
fn from_bits_truncate(bits: u64) -> Permissions
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
fn is_all(&self) -> bool
Returns true
if all flags are currently set.
fn intersects(&self, other: Permissions) -> bool
Returns true
if there are flags common to both self
and other
.
fn contains(&self, other: Permissions) -> bool
Returns true
all of the flags in other
are contained within self
.
fn insert(&mut self, other: Permissions)
Inserts the specified flags in-place.
fn remove(&mut self, other: Permissions)
Removes the specified flags in-place.
fn toggle(&mut self, other: Permissions)
Toggles the specified flags in-place.
fn set(&mut self, other: Permissions, value: bool)
Inserts or removes the specified flags depending on the passed value.
impl Permissions
[src]
fn add_reactions(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Add Reactions permission.
fn administrator(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Administrator permission.
fn attach_files(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Attach Files permission.
fn ban_members(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Ban Members permission.
fn change_nickname(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Change Nickname permission.
fn connect(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Connect permission.
fn create_invite(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Create Invite permission.
fn deafen_members(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Deafen Members permission.
fn embed_links(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Embed Links permission.
fn external_emojis(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Use External Emojis permission.
fn kick_members(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Kick Members permission.
fn manage_channels(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Channels permission.
fn manage_emojis(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Emojis permission.
fn manage_guild(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Guild permission.
fn manage_messages(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Messages permission.
fn manage_nicknames(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Nicknames permission.
fn manage_roles(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Roles permission.
fn manage_webhooks(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Manage Webhooks permission.
fn mention_everyone(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Mention Everyone permission.
fn move_members(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Move Members permission.
fn mute_members(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Mute Members permission.
fn read_message_history(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Read Message History permission.
fn read_messages(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Read Messages permission.
fn send_messages(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Send Messages permission.
fn send_tts_messages(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Send TTS Messages permission.
fn speak(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Speak permission.
fn use_external_emojis(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Use External Emojis permission.
fn use_vad(&self) -> bool
[src]
Shorthand for checking that the set of permissions contains the Use VAD permission.
Trait Implementations
impl Copy for Permissions
impl PartialEq for Permissions
fn eq(&self, __arg_0: &Permissions) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Permissions) -> bool
This method tests for !=
.
impl Eq for Permissions
impl Clone for Permissions
fn clone(&self) -> Permissions
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd for Permissions
fn partial_cmp(&self, __arg_0: &Permissions) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Permissions) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Permissions) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Permissions) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Permissions) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Permissions
fn cmp(&self, __arg_0: &Permissions) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for Permissions
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Permissions
impl Binary for Permissions
impl Octal for Permissions
impl LowerHex for Permissions
impl UpperHex for Permissions
impl BitOr for Permissions
type Output = Permissions
The resulting type after applying the |
operator.
fn bitor(self, other: Permissions) -> Permissions
Returns the union of the two sets of flags.
impl BitOrAssign for Permissions
fn bitor_assign(&mut self, other: Permissions)
Adds the set of flags.
impl BitXor for Permissions
type Output = Permissions
The resulting type after applying the ^
operator.
fn bitxor(self, other: Permissions) -> Permissions
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for Permissions
fn bitxor_assign(&mut self, other: Permissions)
Toggles the set of flags.
impl BitAnd for Permissions
type Output = Permissions
The resulting type after applying the &
operator.
fn bitand(self, other: Permissions) -> Permissions
Returns the intersection between the two sets of flags.
impl BitAndAssign for Permissions
fn bitand_assign(&mut self, other: Permissions)
Disables all flags disabled in the set.
impl Sub for Permissions
type Output = Permissions
The resulting type after applying the -
operator.
fn sub(self, other: Permissions) -> Permissions
Returns the set difference of the two sets of flags.
impl SubAssign for Permissions
fn sub_assign(&mut self, other: Permissions)
Disables all flags enabled in the set.
impl Not for Permissions
type Output = Permissions
The resulting type after applying the !
operator.
fn not(self) -> Permissions
Returns the complement of this set of flags.
impl Extend<Permissions> for Permissions
fn extend<T: IntoIterator<Item = Permissions>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Permissions> for Permissions
fn from_iter<T: IntoIterator<Item = Permissions>>(iterator: T) -> Permissions
Creates a value from an iterator. Read more
impl<'de> Deserialize<'de> for Permissions
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
[src]
deserializer: D
) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more