[−][src]Struct serenity::model::permissions::Permissions
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
impl Permissions
pub const CREATE_INVITE: Permissions
Allows for the creation of RichInvite
s.
pub const KICK_MEMBERS: Permissions
Allows for the kicking of guild members.
pub const BAN_MEMBERS: Permissions
Allows the banning of guild members.
pub const ADMINISTRATOR: Permissions
Allows all permissions, bypassing channel permission overwrites.
pub const MANAGE_CHANNELS: Permissions
Allows management and editing of guild channels.
pub const MANAGE_GUILD: Permissions
Allows management and editing of the guild.
pub const ADD_REACTIONS: Permissions
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.
pub const VIEW_AUDIT_LOG: Permissions
Allows viewing a guild's audit logs.
pub const PRIORITY_SPEAKER: Permissions
Allows the use of priority speaking in voice channels.
pub const READ_MESSAGES: Permissions
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
Allows sending messages in a guild channel.
pub const SEND_TTS_MESSAGES: Permissions
Allows the sending of text-to-speech messages in a channel.
pub const MANAGE_MESSAGES: Permissions
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
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
Allows uploading of files.
pub const READ_MESSAGE_HISTORY: Permissions
Allows the reading of a channel's message history.
pub const MENTION_EVERYONE: Permissions
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
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
Allows the joining of a voice channel.
pub const SPEAK: Permissions
Allows the user to speak in a voice channel.
pub const MUTE_MEMBERS: Permissions
Allows the muting of members in a voice channel.
pub const DEAFEN_MEMBERS: Permissions
Allows the deafening of members in a voice channel.
pub const MOVE_MEMBERS: Permissions
Allows the moving of members from one voice channel to another.
pub const USE_VAD: Permissions
Allows the usage of voice-activity-detection in a voice channel.
If this is disabled, then Member
s must use push-to-talk.
pub const CHANGE_NICKNAME: Permissions
Allows members to change their own nickname in the guild.
pub const MANAGE_NICKNAMES: Permissions
Allows members to change other members' nicknames.
pub const MANAGE_ROLES: Permissions
Allows management and editing of roles below their own.
pub const MANAGE_WEBHOOKS: Permissions
Allows management of webhooks.
pub const MANAGE_EMOJIS: Permissions
Allows management of emojis created without the use of an
Integration
.
pub fn empty() -> Permissions
pub fn empty() -> Permissions
Returns an empty set of flags.
pub fn all() -> Permissions
pub fn all() -> Permissions
Returns the set containing all flags.
pub fn bits(&self) -> u64
pub fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u64) -> Option<Permissions>
pub fn from_bits(bits: u64) -> Option<Permissions>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u64) -> Permissions
pub fn from_bits_truncate(bits: u64) -> Permissions
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: Permissions) -> bool
pub fn intersects(&self, other: Permissions) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: Permissions) -> bool
pub fn contains(&self, other: Permissions) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Permissions)
pub fn insert(&mut self, other: Permissions)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Permissions)
pub fn remove(&mut self, other: Permissions)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Permissions)
pub fn toggle(&mut self, other: Permissions)
Toggles the specified flags in-place.
pub fn set(&mut self, other: Permissions, value: bool)
pub fn set(&mut self, other: Permissions, value: bool)
Inserts or removes the specified flags depending on the passed value.
impl Permissions
[src]
impl Permissions
pub fn add_reactions(&self) -> bool
[src]
pub fn add_reactions(&self) -> bool
Shorthand for checking that the set of permissions contains the Add Reactions permission.
pub fn administrator(&self) -> bool
[src]
pub fn administrator(&self) -> bool
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
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
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
Shorthand for checking that the set of permissions contains the Change Nickname permission.
pub fn connect(&self) -> bool
[src]
pub fn connect(&self) -> bool
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
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
Shorthand for checking that the set of permission contains the Priority Speaker permission.
pub fn create_invite(&self) -> bool
[src]
pub fn create_invite(&self) -> bool
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Shorthand for checking that the set of permissions contains the Speak permission.
pub fn use_external_emojis(&self) -> bool
[src]
pub fn use_external_emojis(&self) -> bool
Shorthand for checking that the set of permissions contains the Use External Emojis permission.
pub fn use_vad(&self) -> bool
[src]
pub fn use_vad(&self) -> bool
Shorthand for checking that the set of permissions contains the Use VAD permission.
Trait Implementations
impl PartialOrd<Permissions> for Permissions
[src]
impl PartialOrd<Permissions> for Permissions
fn partial_cmp(&self, other: &Permissions) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Permissions) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Permissions) -> bool
[src]
fn lt(&self, other: &Permissions) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Permissions) -> bool
[src]
fn le(&self, other: &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, other: &Permissions) -> bool
[src]
fn gt(&self, other: &Permissions) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Permissions) -> bool
[src]
fn ge(&self, other: &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
[src]
impl Ord for Permissions
fn cmp(&self, other: &Permissions) -> Ordering
[src]
fn cmp(&self, other: &Permissions) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialEq<Permissions> for Permissions
[src]
impl PartialEq<Permissions> for Permissions
fn eq(&self, other: &Permissions) -> bool
[src]
fn eq(&self, other: &Permissions) -> bool
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
This method tests for !=
.
impl Clone for Permissions
[src]
impl Clone for Permissions
fn clone(&self) -> Permissions
[src]
fn clone(&self) -> Permissions
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)
Performs copy-assignment from source
. Read more
impl Extend<Permissions> for Permissions
impl Extend<Permissions> for Permissions
fn extend<T: IntoIterator<Item = Permissions>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Permissions>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl Copy for Permissions
[src]
impl Copy for Permissions
impl Eq for Permissions
[src]
impl Eq for Permissions
impl Debug for Permissions
impl Debug for Permissions
impl Sub<Permissions> for Permissions
impl Sub<Permissions> for Permissions
type Output = Permissions
The resulting type after applying the -
operator.
fn sub(self, other: Permissions) -> Permissions
fn sub(self, other: Permissions) -> Permissions
Returns the set difference of the two sets of flags.
impl SubAssign<Permissions> for Permissions
impl SubAssign<Permissions> for Permissions
fn sub_assign(&mut self, other: Permissions)
fn sub_assign(&mut self, other: Permissions)
Disables all flags enabled in the set.
impl Not for Permissions
impl Not for Permissions
type Output = Permissions
The resulting type after applying the !
operator.
fn not(self) -> Permissions
fn not(self) -> Permissions
Returns the complement of this set of flags.
impl BitAnd<Permissions> for Permissions
impl BitAnd<Permissions> for Permissions
type Output = Permissions
The resulting type after applying the &
operator.
fn bitand(self, other: Permissions) -> Permissions
fn bitand(self, other: Permissions) -> Permissions
Returns the intersection between the two sets of flags.
impl BitOr<Permissions> for Permissions
impl BitOr<Permissions> for Permissions
type Output = Permissions
The resulting type after applying the |
operator.
fn bitor(self, other: Permissions) -> Permissions
fn bitor(self, other: Permissions) -> Permissions
Returns the union of the two sets of flags.
impl BitXor<Permissions> for Permissions
impl BitXor<Permissions> for Permissions
type Output = Permissions
The resulting type after applying the ^
operator.
fn bitxor(self, other: Permissions) -> Permissions
fn bitxor(self, other: Permissions) -> Permissions
Returns the left flags, but with all the right flags toggled.
impl BitAndAssign<Permissions> for Permissions
impl BitAndAssign<Permissions> for Permissions
fn bitand_assign(&mut self, other: Permissions)
fn bitand_assign(&mut self, other: Permissions)
Disables all flags disabled in the set.
impl BitOrAssign<Permissions> for Permissions
impl BitOrAssign<Permissions> for Permissions
fn bitor_assign(&mut self, other: Permissions)
fn bitor_assign(&mut self, other: Permissions)
Adds the set of flags.
impl BitXorAssign<Permissions> for Permissions
impl BitXorAssign<Permissions> for Permissions
fn bitxor_assign(&mut self, other: Permissions)
fn bitxor_assign(&mut self, other: Permissions)
Toggles the set of flags.
impl Hash for Permissions
[src]
impl Hash for Permissions
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromIterator<Permissions> for Permissions
impl FromIterator<Permissions> for Permissions
fn from_iter<T: IntoIterator<Item = Permissions>>(iterator: T) -> Permissions
fn from_iter<T: IntoIterator<Item = Permissions>>(iterator: T) -> Permissions
Creates a value from an iterator. Read more
impl Octal for Permissions
impl Octal for Permissions
impl Binary for Permissions
impl Binary for Permissions
impl LowerHex for Permissions
impl LowerHex for Permissions
impl UpperHex for Permissions
impl UpperHex for Permissions
impl Serialize for Permissions
[src]
impl Serialize for Permissions
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Permissions
[src]
impl<'de> Deserialize<'de> for Permissions
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl Send for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Sync for Permissions
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 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<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
[src]
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,