Struct serenity::model::permissions::Permissions [−][src]
pub struct Permissions { pub bits: u64, }
Expand description
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.
Fields
bits: u64
Expand description
The flags making up the permissions.
Note
Do not modify this yourself; use the provided methods. Do the same when creating, unless you’re absolutely certain that you’re giving valid permission flags.
Implementations
impl Permissions
[src]
impl Permissions
[src]pub const CREATE_INVITE: Permissions
[src]
pub const CREATE_INVITE: Permissions
[src]Allows for the creation of RichInvite
s.
pub const KICK_MEMBERS: Permissions
[src]
pub const KICK_MEMBERS: Permissions
[src]Allows for the kicking of guild members.
pub const BAN_MEMBERS: Permissions
[src]
pub const BAN_MEMBERS: Permissions
[src]Allows the banning of guild members.
pub const ADMINISTRATOR: Permissions
[src]
pub const ADMINISTRATOR: Permissions
[src]Allows all permissions, bypassing channel permission overwrites.
pub const MANAGE_CHANNELS: Permissions
[src]
pub const MANAGE_CHANNELS: Permissions
[src]Allows management and editing of guild channels.
pub const MANAGE_GUILD: Permissions
[src]
pub const MANAGE_GUILD: Permissions
[src]Allows management and editing of the guild.
pub const ADD_REACTIONS: Permissions
[src]
pub const ADD_REACTIONS: Permissions
[src]pub const VIEW_AUDIT_LOG: Permissions
[src]
pub const VIEW_AUDIT_LOG: Permissions
[src]Allows viewing a guild’s audit logs.
pub const PRIORITY_SPEAKER: Permissions
[src]
pub const PRIORITY_SPEAKER: Permissions
[src]Allows the use of priority speaking in voice channels.
pub const STREAM: Permissions
[src]
pub const READ_MESSAGES: Permissions
[src]
pub const READ_MESSAGES: Permissions
[src]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.
pub const SEND_MESSAGES: Permissions
[src]
pub const SEND_MESSAGES: Permissions
[src]Allows sending messages in a guild channel.
pub const SEND_TTS_MESSAGES: Permissions
[src]
pub const SEND_TTS_MESSAGES: Permissions
[src]Allows the sending of text-to-speech messages in a channel.
pub const MANAGE_MESSAGES: Permissions
[src]
pub const MANAGE_MESSAGES: Permissions
[src]Allows the deleting of other messages in a guild channel.
Note: This does not allow the editing of other messages.
pub const EMBED_LINKS: Permissions
[src]
pub const EMBED_LINKS: Permissions
[src]Allows links from this user - or users of this role - to be embedded, with potential data such as a thumbnail, description, and page name.
pub const ATTACH_FILES: Permissions
[src]
pub const ATTACH_FILES: Permissions
[src]Allows uploading of files.
pub const READ_MESSAGE_HISTORY: Permissions
[src]
pub const READ_MESSAGE_HISTORY: Permissions
[src]Allows the reading of a channel’s message history.
pub const MENTION_EVERYONE: Permissions
[src]
pub const MENTION_EVERYONE: Permissions
[src]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.
pub const USE_EXTERNAL_EMOJIS: Permissions
[src]
pub const USE_EXTERNAL_EMOJIS: Permissions
[src]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.
pub const CONNECT: Permissions
[src]
pub const CONNECT: Permissions
[src]Allows the joining of a voice channel.
pub const SPEAK: Permissions
[src]
pub const SPEAK: Permissions
[src]Allows the user to speak in a voice channel.
pub const MUTE_MEMBERS: Permissions
[src]
pub const MUTE_MEMBERS: Permissions
[src]Allows the muting of members in a voice channel.
pub const DEAFEN_MEMBERS: Permissions
[src]
pub const DEAFEN_MEMBERS: Permissions
[src]Allows the deafening of members in a voice channel.
pub const MOVE_MEMBERS: Permissions
[src]
pub const MOVE_MEMBERS: Permissions
[src]Allows the moving of members from one voice channel to another.
pub const USE_VAD: Permissions
[src]
pub const USE_VAD: Permissions
[src]pub const CHANGE_NICKNAME: Permissions
[src]
pub const CHANGE_NICKNAME: Permissions
[src]Allows members to change their own nickname in the guild.
pub const MANAGE_NICKNAMES: Permissions
[src]
pub const MANAGE_NICKNAMES: Permissions
[src]Allows members to change other members’ nicknames.
pub const MANAGE_ROLES: Permissions
[src]
pub const MANAGE_ROLES: Permissions
[src]Allows management and editing of roles below their own.
pub const MANAGE_WEBHOOKS: Permissions
[src]
pub const MANAGE_WEBHOOKS: Permissions
[src]Allows management of webhooks.
pub const MANAGE_EMOJIS: Permissions
[src]
pub const MANAGE_EMOJIS: Permissions
[src]Allows management of emojis created without the use of an
Integration
.
pub const REQUEST_TO_SPEAK: Permissions
[src]
pub const REQUEST_TO_SPEAK: Permissions
[src]Allows for requesting to speak in stage channels.
pub const USE_SLASH_COMMANDS: Permissions
[src]
pub const USE_SLASH_COMMANDS: Permissions
[src]Allows using slash commands.
pub const fn empty() -> Permissions
[src]
pub const fn empty() -> Permissions
[src]Returns an empty set of flags
pub const fn all() -> Permissions
[src]
pub const fn all() -> Permissions
[src]Returns the set containing all flags.
pub fn from_bits(bits: u64) -> Option<Permissions>
[src]
pub fn from_bits(bits: u64) -> Option<Permissions>
[src]Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u64) -> Permissions
[src]
pub const fn from_bits_truncate(bits: u64) -> Permissions
[src]Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u64) -> Permissions
[src]
pub const unsafe fn from_bits_unchecked(bits: u64) -> Permissions
[src]Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const fn intersects(&self, other: Permissions) -> bool
[src]
pub const fn intersects(&self, other: Permissions) -> bool
[src]Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: Permissions) -> bool
[src]
pub const fn contains(&self, other: Permissions) -> bool
[src]Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Permissions)
[src]
pub fn insert(&mut self, other: Permissions)
[src]Inserts the specified flags in-place.
pub fn remove(&mut self, other: Permissions)
[src]
pub fn remove(&mut self, other: Permissions)
[src]Removes the specified flags in-place.
pub fn toggle(&mut self, other: Permissions)
[src]
pub fn toggle(&mut self, other: Permissions)
[src]Toggles the specified flags in-place.
pub fn set(&mut self, other: Permissions, value: bool)
[src]
pub fn set(&mut self, other: Permissions, value: bool)
[src]Inserts or removes the specified flags depending on the passed value.
impl Permissions
[src]
impl Permissions
[src]pub fn get_permission_names(self) -> Vec<&'static str>
[src]
pub fn get_permission_names(self) -> Vec<&'static str>
[src]Returns a list of names of all contained permissions.
impl Permissions
[src]
impl Permissions
[src]pub fn add_reactions(self) -> bool
[src]
pub fn add_reactions(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Add Reactions permission.
pub fn administrator(self) -> bool
[src]
pub fn administrator(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Administrator permission.
pub fn attach_files(self) -> bool
[src]
pub fn attach_files(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Attach Files permission.
pub fn ban_members(self) -> bool
[src]
pub fn ban_members(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Ban Members permission.
pub fn change_nickname(self) -> bool
[src]
pub fn change_nickname(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Change Nickname permission.
pub fn connect(self) -> bool
[src]
pub fn connect(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Connect permission.
pub fn view_audit_log(self) -> bool
[src]
pub fn view_audit_log(self) -> bool
[src]Shorthand for checking that the set of permissions contains the View Audit Log permission.
pub fn priority_speaker(self) -> bool
[src]
pub fn priority_speaker(self) -> bool
[src]Shorthand for checking that the set of permission contains the Priority Speaker permission.
pub fn stream(self) -> bool
[src]
pub fn stream(self) -> bool
[src]Shorthand for checking that the set of permission contains the Stream permission.
pub fn create_invite(self) -> bool
[src]
pub fn create_invite(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Create Invite permission.
pub fn deafen_members(self) -> bool
[src]
pub fn deafen_members(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Deafen Members permission.
pub fn embed_links(self) -> bool
[src]
pub fn embed_links(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Embed Links permission.
pub fn external_emojis(self) -> bool
[src]
pub fn external_emojis(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Use External Emojis permission.
pub fn kick_members(self) -> bool
[src]
pub fn kick_members(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Kick Members permission.
pub fn manage_channels(self) -> bool
[src]
pub fn manage_channels(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Channels permission.
pub fn manage_emojis(self) -> bool
[src]
pub fn manage_emojis(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Emojis permission.
pub fn manage_guild(self) -> bool
[src]
pub fn manage_guild(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Guild permission.
pub fn manage_messages(self) -> bool
[src]
pub fn manage_messages(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Messages permission.
pub fn manage_nicknames(self) -> bool
[src]
pub fn manage_nicknames(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Nicknames permission.
pub fn manage_roles(self) -> bool
[src]
pub fn manage_roles(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Roles permission.
pub fn manage_webhooks(self) -> bool
[src]
pub fn manage_webhooks(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Manage Webhooks permission.
pub fn mention_everyone(self) -> bool
[src]
pub fn mention_everyone(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Mention Everyone permission.
pub fn move_members(self) -> bool
[src]
pub fn move_members(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Move Members permission.
pub fn mute_members(self) -> bool
[src]
pub fn mute_members(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Mute Members permission.
pub fn read_message_history(self) -> bool
[src]
pub fn read_message_history(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Read Message History permission.
pub fn read_messages(self) -> bool
[src]
pub fn read_messages(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Read Messages permission.
pub fn send_messages(self) -> bool
[src]
pub fn send_messages(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Send Messages permission.
pub fn send_tts_messages(self) -> bool
[src]
pub fn send_tts_messages(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Send TTS Messages permission.
pub fn speak(self) -> bool
[src]
pub fn speak(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Speak permission.
pub fn request_to_speak(self) -> bool
[src]
pub fn request_to_speak(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Request To Speak permission.
pub fn use_external_emojis(self) -> bool
[src]
pub fn use_external_emojis(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Use External Emojis permission.
pub fn use_slash_commands(self) -> bool
[src]
pub fn use_slash_commands(self) -> bool
[src]Shorthand for checking that the set of permissions contains the Use Slash Commands permission.
Trait Implementations
impl Binary for Permissions
[src]
impl Binary for Permissions
[src]impl BitAnd<Permissions> for Permissions
[src]
impl BitAnd<Permissions> for Permissions
[src]fn bitand(self, other: Permissions) -> Permissions
[src]
fn bitand(self, other: Permissions) -> Permissions
[src]Returns the intersection between the two sets of flags.
type Output = Permissions
type Output = Permissions
The resulting type after applying the &
operator.
impl BitAndAssign<Permissions> for Permissions
[src]
impl BitAndAssign<Permissions> for Permissions
[src]fn bitand_assign(&mut self, other: Permissions)
[src]
fn bitand_assign(&mut self, other: Permissions)
[src]Disables all flags disabled in the set.
impl BitOr<Permissions> for Permissions
[src]
impl BitOr<Permissions> for Permissions
[src]fn bitor(self, other: Permissions) -> Permissions
[src]
fn bitor(self, other: Permissions) -> Permissions
[src]Returns the union of the two sets of flags.
type Output = Permissions
type Output = Permissions
The resulting type after applying the |
operator.
impl BitOrAssign<Permissions> for Permissions
[src]
impl BitOrAssign<Permissions> for Permissions
[src]fn bitor_assign(&mut self, other: Permissions)
[src]
fn bitor_assign(&mut self, other: Permissions)
[src]Adds the set of flags.
impl BitXor<Permissions> for Permissions
[src]
impl BitXor<Permissions> for Permissions
[src]fn bitxor(self, other: Permissions) -> Permissions
[src]
fn bitxor(self, other: Permissions) -> Permissions
[src]Returns the left flags, but with all the right flags toggled.
type Output = Permissions
type Output = Permissions
The resulting type after applying the ^
operator.
impl BitXorAssign<Permissions> for Permissions
[src]
impl BitXorAssign<Permissions> for Permissions
[src]fn bitxor_assign(&mut self, other: Permissions)
[src]
fn bitxor_assign(&mut self, other: Permissions)
[src]Toggles the set of flags.
impl Clone for Permissions
[src]
impl Clone for Permissions
[src]fn clone(&self) -> Permissions
[src]
fn clone(&self) -> Permissions
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for Permissions
[src]
impl Debug for Permissions
[src]impl Default for Permissions
[src]
impl Default for Permissions
[src]impl<'de> Deserialize<'de> for Permissions
[src]
impl<'de> Deserialize<'de> for Permissions
[src]fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]Deserialize this value from the given Serde deserializer. Read more
impl Display for Permissions
[src]
impl Display for Permissions
[src]impl Extend<Permissions> for Permissions
[src]
impl Extend<Permissions> for Permissions
[src]fn extend<T: IntoIterator<Item = Permissions>>(&mut self, iterator: T)
[src]
fn extend<T: IntoIterator<Item = Permissions>>(&mut self, iterator: T)
[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)
[src]
fn extend_one(&mut self, item: A)
[src]extend_one
)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl FromIterator<Permissions> for Permissions
[src]
impl FromIterator<Permissions> for Permissions
[src]fn from_iter<T: IntoIterator<Item = Permissions>>(iterator: T) -> Permissions
[src]
fn from_iter<T: IntoIterator<Item = Permissions>>(iterator: T) -> Permissions
[src]Creates a value from an iterator. Read more
impl Hash for Permissions
[src]
impl Hash for Permissions
[src]impl LowerHex for Permissions
[src]
impl LowerHex for Permissions
[src]impl Not for Permissions
[src]
impl Not for Permissions
[src]fn not(self) -> Permissions
[src]
fn not(self) -> Permissions
[src]Returns the complement of this set of flags.
type Output = Permissions
type Output = Permissions
The resulting type after applying the !
operator.
impl Octal for Permissions
[src]
impl Octal for Permissions
[src]impl Ord for Permissions
[src]
impl Ord for Permissions
[src]impl PartialEq<Permissions> for Permissions
[src]
impl PartialEq<Permissions> for Permissions
[src]fn eq(&self, other: &Permissions) -> bool
[src]
fn eq(&self, other: &Permissions) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &Permissions) -> bool
[src]
fn ne(&self, other: &Permissions) -> bool
[src]This method tests for !=
.
impl PartialOrd<Permissions> for Permissions
[src]
impl PartialOrd<Permissions> for Permissions
[src]fn partial_cmp(&self, other: &Permissions) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Permissions) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Serialize for Permissions
[src]
impl Serialize for Permissions
[src]impl Sub<Permissions> for Permissions
[src]
impl Sub<Permissions> for Permissions
[src]fn sub(self, other: Permissions) -> Permissions
[src]
fn sub(self, other: Permissions) -> Permissions
[src]Returns the set difference of the two sets of flags.
type Output = Permissions
type Output = Permissions
The resulting type after applying the -
operator.
impl SubAssign<Permissions> for Permissions
[src]
impl SubAssign<Permissions> for Permissions
[src]fn sub_assign(&mut self, other: Permissions)
[src]
fn sub_assign(&mut self, other: Permissions)
[src]Disables all flags enabled in the set.
impl UpperHex for Permissions
[src]
impl UpperHex for Permissions
[src]impl Copy for Permissions
[src]
impl Eq for Permissions
[src]
impl StructuralEq for Permissions
[src]
impl StructuralPartialEq for Permissions
[src]
Auto Trait Implementations
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,