Struct discord_flows::model::UserPublicFlags
source · pub struct UserPublicFlags { /* private fields */ }
Expand description
User’s public flags
Implementations§
source§impl UserPublicFlags
impl UserPublicFlags
sourcepub const DISCORD_EMPLOYEE: UserPublicFlags = _
pub const DISCORD_EMPLOYEE: UserPublicFlags = _
User’s flag as discord employee
sourcepub const PARTNERED_SERVER_OWNER: UserPublicFlags = _
pub const PARTNERED_SERVER_OWNER: UserPublicFlags = _
User’s flag as partnered server owner
sourcepub const HYPESQUAD_EVENTS: UserPublicFlags = _
pub const HYPESQUAD_EVENTS: UserPublicFlags = _
User’s flag as hypesquad events
sourcepub const BUG_HUNTER_LEVEL_1: UserPublicFlags = _
pub const BUG_HUNTER_LEVEL_1: UserPublicFlags = _
User’s flag as bug hunter level 1
sourcepub const HOUSE_BRAVERY: UserPublicFlags = _
pub const HOUSE_BRAVERY: UserPublicFlags = _
User’s flag as house bravery
sourcepub const HOUSE_BRILLIANCE: UserPublicFlags = _
pub const HOUSE_BRILLIANCE: UserPublicFlags = _
User’s flag as house brilliance
sourcepub const HOUSE_BALANCE: UserPublicFlags = _
pub const HOUSE_BALANCE: UserPublicFlags = _
User’s flag as house balance
sourcepub const EARLY_SUPPORTER: UserPublicFlags = _
pub const EARLY_SUPPORTER: UserPublicFlags = _
User’s flag as early supporter
sourcepub const TEAM_USER: UserPublicFlags = _
pub const TEAM_USER: UserPublicFlags = _
User’s flag as team user
sourcepub const SYSTEM: UserPublicFlags = _
pub const SYSTEM: UserPublicFlags = _
User’s flag as system
sourcepub const BUG_HUNTER_LEVEL_2: UserPublicFlags = _
pub const BUG_HUNTER_LEVEL_2: UserPublicFlags = _
User’s flag as bug hunter level 2
sourcepub const VERIFIED_BOT: UserPublicFlags = _
pub const VERIFIED_BOT: UserPublicFlags = _
User’s flag as verified bot
sourcepub const EARLY_VERIFIED_BOT_DEVELOPER: UserPublicFlags = _
pub const EARLY_VERIFIED_BOT_DEVELOPER: UserPublicFlags = _
User’s flag as early verified bot developer
sourcepub const DISCORD_CERTIFIED_MODERATOR: UserPublicFlags = _
pub const DISCORD_CERTIFIED_MODERATOR: UserPublicFlags = _
User’s flag as discord certified moderator
sourcepub const BOT_HTTP_INTERACTIONS: UserPublicFlags = _
pub const BOT_HTTP_INTERACTIONS: UserPublicFlags = _
Bot’s running with HTTP interactions
sourcepub const ACTIVE_DEVELOPER: UserPublicFlags = _
pub const ACTIVE_DEVELOPER: UserPublicFlags = _
User’s flag as active developer
sourcepub const fn empty() -> UserPublicFlags
pub const fn empty() -> UserPublicFlags
Returns an empty set of flags.
sourcepub const fn all() -> UserPublicFlags
pub const fn all() -> UserPublicFlags
Returns the set containing all flags.
sourcepub const fn from_bits(bits: u32) -> Option<UserPublicFlags>
pub const fn from_bits(bits: u32) -> Option<UserPublicFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> UserPublicFlags
pub const fn from_bits_truncate(bits: u32) -> UserPublicFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> UserPublicFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> UserPublicFlags
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.
sourcepub const fn intersects(&self, other: UserPublicFlags) -> bool
pub const fn intersects(&self, other: UserPublicFlags) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: UserPublicFlags) -> bool
pub const fn contains(&self, other: UserPublicFlags) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: UserPublicFlags)
pub fn insert(&mut self, other: UserPublicFlags)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: UserPublicFlags)
pub fn remove(&mut self, other: UserPublicFlags)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: UserPublicFlags)
pub fn toggle(&mut self, other: UserPublicFlags)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: UserPublicFlags, value: bool)
pub fn set(&mut self, other: UserPublicFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: UserPublicFlags) -> UserPublicFlags
pub const fn intersection(self, other: UserPublicFlags) -> UserPublicFlags
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
.
sourcepub const fn union(self, other: UserPublicFlags) -> UserPublicFlags
pub const fn union(self, other: UserPublicFlags) -> UserPublicFlags
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
.
sourcepub const fn difference(self, other: UserPublicFlags) -> UserPublicFlags
pub const fn difference(self, other: UserPublicFlags) -> UserPublicFlags
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
.
sourcepub const fn symmetric_difference(
self,
other: UserPublicFlags
) -> UserPublicFlags
pub const fn symmetric_difference( self, other: UserPublicFlags ) -> UserPublicFlags
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
.
sourcepub const fn complement(self) -> UserPublicFlags
pub const fn complement(self) -> UserPublicFlags
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
.
Trait Implementations§
source§impl Binary for UserPublicFlags
impl Binary for UserPublicFlags
source§impl BitAnd<UserPublicFlags> for UserPublicFlags
impl BitAnd<UserPublicFlags> for UserPublicFlags
source§fn bitand(self, other: UserPublicFlags) -> UserPublicFlags
fn bitand(self, other: UserPublicFlags) -> UserPublicFlags
Returns the intersection between the two sets of flags.
§type Output = UserPublicFlags
type Output = UserPublicFlags
&
operator.source§impl BitAndAssign<UserPublicFlags> for UserPublicFlags
impl BitAndAssign<UserPublicFlags> for UserPublicFlags
source§fn bitand_assign(&mut self, other: UserPublicFlags)
fn bitand_assign(&mut self, other: UserPublicFlags)
Disables all flags disabled in the set.
source§impl BitOr<UserPublicFlags> for UserPublicFlags
impl BitOr<UserPublicFlags> for UserPublicFlags
source§fn bitor(self, other: UserPublicFlags) -> UserPublicFlags
fn bitor(self, other: UserPublicFlags) -> UserPublicFlags
Returns the union of the two sets of flags.
§type Output = UserPublicFlags
type Output = UserPublicFlags
|
operator.source§impl BitOrAssign<UserPublicFlags> for UserPublicFlags
impl BitOrAssign<UserPublicFlags> for UserPublicFlags
source§fn bitor_assign(&mut self, other: UserPublicFlags)
fn bitor_assign(&mut self, other: UserPublicFlags)
Adds the set of flags.
source§impl BitXor<UserPublicFlags> for UserPublicFlags
impl BitXor<UserPublicFlags> for UserPublicFlags
source§fn bitxor(self, other: UserPublicFlags) -> UserPublicFlags
fn bitxor(self, other: UserPublicFlags) -> UserPublicFlags
Returns the left flags, but with all the right flags toggled.
§type Output = UserPublicFlags
type Output = UserPublicFlags
^
operator.source§impl BitXorAssign<UserPublicFlags> for UserPublicFlags
impl BitXorAssign<UserPublicFlags> for UserPublicFlags
source§fn bitxor_assign(&mut self, other: UserPublicFlags)
fn bitxor_assign(&mut self, other: UserPublicFlags)
Toggles the set of flags.
source§impl Clone for UserPublicFlags
impl Clone for UserPublicFlags
source§fn clone(&self) -> UserPublicFlags
fn clone(&self) -> UserPublicFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UserPublicFlags
impl Debug for UserPublicFlags
source§impl Default for UserPublicFlags
impl Default for UserPublicFlags
source§fn default() -> UserPublicFlags
fn default() -> UserPublicFlags
source§impl<'de> Deserialize<'de> for UserPublicFlags
impl<'de> Deserialize<'de> for UserPublicFlags
source§fn deserialize<D>(
deserializer: D
) -> Result<UserPublicFlags, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<UserPublicFlags, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl Extend<UserPublicFlags> for UserPublicFlags
impl Extend<UserPublicFlags> for UserPublicFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = UserPublicFlags>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = UserPublicFlags>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<UserPublicFlags> for UserPublicFlags
impl FromIterator<UserPublicFlags> for UserPublicFlags
source§fn from_iter<T>(iterator: T) -> UserPublicFlagswhere
T: IntoIterator<Item = UserPublicFlags>,
fn from_iter<T>(iterator: T) -> UserPublicFlagswhere T: IntoIterator<Item = UserPublicFlags>,
source§impl Hash for UserPublicFlags
impl Hash for UserPublicFlags
source§impl LowerHex for UserPublicFlags
impl LowerHex for UserPublicFlags
source§impl Not for UserPublicFlags
impl Not for UserPublicFlags
source§fn not(self) -> UserPublicFlags
fn not(self) -> UserPublicFlags
Returns the complement of this set of flags.
§type Output = UserPublicFlags
type Output = UserPublicFlags
!
operator.source§impl Octal for UserPublicFlags
impl Octal for UserPublicFlags
source§impl Ord for UserPublicFlags
impl Ord for UserPublicFlags
source§fn cmp(&self, other: &UserPublicFlags) -> Ordering
fn cmp(&self, other: &UserPublicFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<UserPublicFlags> for UserPublicFlags
impl PartialEq<UserPublicFlags> for UserPublicFlags
source§fn eq(&self, other: &UserPublicFlags) -> bool
fn eq(&self, other: &UserPublicFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<UserPublicFlags> for UserPublicFlags
impl PartialOrd<UserPublicFlags> for UserPublicFlags
source§fn partial_cmp(&self, other: &UserPublicFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &UserPublicFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for UserPublicFlags
impl Serialize for UserPublicFlags
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
source§impl Sub<UserPublicFlags> for UserPublicFlags
impl Sub<UserPublicFlags> for UserPublicFlags
source§fn sub(self, other: UserPublicFlags) -> UserPublicFlags
fn sub(self, other: UserPublicFlags) -> UserPublicFlags
Returns the set difference of the two sets of flags.
§type Output = UserPublicFlags
type Output = UserPublicFlags
-
operator.source§impl SubAssign<UserPublicFlags> for UserPublicFlags
impl SubAssign<UserPublicFlags> for UserPublicFlags
source§fn sub_assign(&mut self, other: UserPublicFlags)
fn sub_assign(&mut self, other: UserPublicFlags)
Disables all flags enabled in the set.