Struct serenity::model::permissions::Permissions[][src]

pub struct Permissions {
    pub bits: u64,
}
Expand description

A set of permissions that can be assigned to Users and Roles via PermissionOverwrites, roles globally in a Guild, and to GuildChannels.

Fields

bits: u64

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

Allows for the creation of RichInvites.

Allows for the kicking of guild members.

Allows the banning of guild members.

Allows all permissions, bypassing channel permission overwrites.

Allows management and editing of guild channels.

Allows management and editing of the guild.

Members with this permission can add new Reactions to a Message. Members can still react using reactions already added to messages without this permission.

Allows viewing a guild’s audit logs.

Allows the use of priority speaking in voice channels.

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.

Allows sending messages in a guild channel.

Allows the sending of text-to-speech messages in a channel.

Allows the deleting of other messages in a guild channel.

Note: This does not allow the editing of other messages.

Allows links from this user - or users of this role - to be embedded, with potential data such as a thumbnail, description, and page name.

Allows uploading of files.

Allows the reading of a channel’s message history.

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.

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.

Allows for viewing guild insights.

Allows the joining of a voice channel.

Allows the user to speak in a voice channel.

Allows the muting of members in a voice channel.

Allows the deafening of members in a voice channel.

Allows the moving of members from one voice channel to another.

Allows the usage of voice-activity-detection in a voice channel.

If this is disabled, then Members must use push-to-talk.

Allows members to change their own nickname in the guild.

Allows members to change other members’ nicknames.

Allows management and editing of roles below their own.

Allows management of webhooks.

Allows management of emojis and stickers created without the use of an Integration.

Allows using slash commands.

Allows for requesting to speak in stage channels.

Allows for deleting and archiving threads, and viewing all private threads.

Allows for creating threads.

Allows for creating private threads.

Allows the usage of custom stickers from other servers.

Allows for sending messages in threads

Allows for launching activities in a voice channel

Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.

👎 Deprecated:

This permission no longer exists

Allows for creating and participating in public threads.

👎 Deprecated:

This permission no longer exists

Returns an empty set of flags.

Returns the set containing all flags.

Returns the raw value of the flags currently stored.

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

Safety

The caller of the bitflags! macro can chose to allow or disallow extra bits for their bitflags type.

The caller of from_bits_unchecked() has to ensure that all bits correspond to a defined flag or that extra bits are valid for this bitflags type.

Returns true if no flags are currently stored.

Returns true if all flags are currently set.

Returns true if there are flags common to both self and other.

Returns true if all of the flags in other are contained within self.

Inserts the specified flags in-place.

Removes the specified flags in-place.

Toggles the specified flags in-place.

Inserts or removes the specified flags depending on the passed value.

Returns the intersection between the flags in self and other.

Specifically, the returned set contains only the flags which are present in both self and other.

This is equivalent to using the & operator (e.g. ops::BitAnd), as in flags & other.

Returns the union of between the flags in self and other.

Specifically, the returned set contains all flags which are present in either self or other, including any which are present in both (see Self::symmetric_difference if that is undesirable).

This is equivalent to using the | operator (e.g. ops::BitOr), as in flags | other.

Returns the difference between the flags in self and other.

Specifically, the returned set contains all flags present in self, except for the ones present in other.

It is also conceptually equivalent to the “bit-clear” operation: flags & !other (and this syntax is also supported).

This is equivalent to using the - operator (e.g. ops::Sub), as in flags - other.

Returns the symmetric difference between the flags in self and other.

Specifically, the returned set contains the flags present which are present in self or other, but that are not present in both. Equivalently, it contains the flags present in exactly one of the sets self and other.

This is equivalent to using the ^ operator (e.g. ops::BitXor), as in flags ^ other.

Returns the complement of this set of flags.

Specifically, the returned set contains all the flags which are not set in self, but which are allowed for this type.

Alternatively, it can be thought of as the set difference between Self::all() and self (e.g. Self::all() - self)

This is equivalent to using the ! operator (e.g. ops::Not), as in !flags.

Returns a list of names of all contained permissions.

Shorthand for checking that the set of permissions contains the Add Reactions permission.

Shorthand for checking that the set of permissions contains the Administrator permission.

Shorthand for checking that the set of permissions contains the Attach Files permission.

Shorthand for checking that the set of permissions contains the Ban Members permission.

Shorthand for checking that the set of permissions contains the Change Nickname permission.

Shorthand for checking that the set of permissions contains the Connect permission.

Shorthand for checking that the set of permissions contains the View Audit Log permission.

Shorthand for checking that the set of permission contains the Priority Speaker permission.

Shorthand for checking that the set of permission contains the Stream permission.

Shorthand for checking that the set of permissions contains the Create Invite permission.

Shorthand for checking that the set of permissions contains the Deafen Members permission.

Shorthand for checking that the set of permissions contains the Embed Links permission.

Shorthand for checking that the set of permissions contains the Use External Emojis permission.

Shorthand for checking that the set of permissions contains the Kick Members permission.

Shorthand for checking that the set of permissions contains the Manage Channels permission.

Shorthand for checking that the set of permissions contains the Manage Emojis permission.

Shorthand for checking that the set of permissions contains the Manage Guild permission.

Shorthand for checking that the set of permissions contains the Manage Messages permission.

Shorthand for checking that the set of permissions contains the Manage Nicknames permission.

Shorthand for checking that the set of permissions contains the Manage Roles permission.

Shorthand for checking that the set of permissions contains the Manage Webhooks permission.

Shorthand for checking that the set of permissions contains the Mention Everyone permission.

Shorthand for checking that the set of permissions contains the Move Members permission.

Shorthand for checking that the set of permissions contains the Mute Members permission.

Shorthand for checking that the set of permissions contains the Read Message History permission.

Shorthand for checking that the set of permissions contains the Read Messages permission.

Shorthand for checking that the set of permissions contains the Send Messages permission.

Shorthand for checking that the set of permissions contains the Send TTS Messages permission.

Shorthand for checking that the set of permissions contains the Speak permission.

Shorthand for checking that the set of permissions contains the Request To Speak permission.

Shorthand for checking that the set of permissions contains the Use External Emojis permission.

Shorthand for checking that the set of permissions contains the Use Slash Commands permission.

Shorthand for checking that the set of permissions contains the Use VAD permission.

Trait Implementations

Formats the value using the given formatter.

Returns the intersection between the two sets of flags.

The resulting type after applying the & operator.

Disables all flags disabled in the set.

Returns the union of the two sets of flags.

The resulting type after applying the | operator.

Adds the set of flags.

Returns the left flags, but with all the right flags toggled.

The resulting type after applying the ^ operator.

Toggles the set of flags.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Formats the value using the given formatter.

Returns the complement of this set of flags.

The resulting type after applying the ! operator.

Formats the value using the given formatter.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Returns the set difference of the two sets of flags.

The resulting type after applying the - operator.

Disables all flags enabled in the set.

Formats the value using the given formatter.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more