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
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 RichInvite
s.
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.
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 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 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
This permission no longer exists
Allows for creating and participating in public threads.
This permission no longer exists
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 there are flags common to both self
and other
.
Returns true
if all of the flags in other
are contained within self
.
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.
Trait Implementations
Disables all flags disabled in the set.
Returns the union of the two sets of flags.
type Output = Self
type Output = Self
The resulting type after applying the |
operator.
Adds the set of flags.
Toggles the set of flags.
Deserialize this value from the given Serde deserializer. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. 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
Disables all flags enabled in the set.
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
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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