Struct bindings::zaun::bot::types::MessageFlags
zaun_bot::bindings::zaun::bot::types::MessageFlags · Struct
pub struct MessageFlags(…)---- messages -------------------------------------------------------
Discord’s values: 4, 64, 4096, 32768. LOADING is host-set only.
Methods
Section titled “Methods”pub const fn empty() -> SelfGet a flags value with all bits unset.
pub const fn all() -> SelfGet a flags value with all known bits set.
pub const fn bits(&self) -> u8Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
from_bits
Section titled “from_bits”pub const fn from_bits(bits: u8) -> Option<Self>Convert from a bits value.
This method will return None if any unknown bits are set.
from_bits_truncate
Section titled “from_bits_truncate”pub const fn from_bits_truncate(bits: u8) -> SelfConvert from a bits value, unsetting any unknown bits.
from_bits_retain
Section titled “from_bits_retain”pub const fn from_bits_retain(bits: u8) -> SelfConvert from a bits value exactly.
from_name
Section titled “from_name”pub fn from_name(name: &str) -> Option<Self>Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
is_empty
Section titled “is_empty”pub const fn is_empty(&self) -> boolWhether all bits in self are unset.
is_all
Section titled “is_all”pub const fn is_all(&self) -> boolWhether all known bits in this flags value are set.
intersects
Section titled “intersects”pub const fn intersects(&self, other: Self) -> boolWhether any set bits in other are also set in self.
contains
Section titled “contains”pub const fn contains(&self, other: Self) -> boolWhether all set bits in other are also set in self.
insert
Section titled “insert”pub fn insert(&mut self, other: Self)The bitwise or (|) of the bits in self and other.
remove
Section titled “remove”pub fn remove(&mut self, other: Self)The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
toggle
Section titled “toggle”pub fn toggle(&mut self, other: Self)The bitwise exclusive-or (^) of the bits in self and other.
pub fn set(&mut self, other: Self, value: bool)Call insert when value is true or remove when value is false.
intersection
Section titled “intersection”pub const fn intersection(self, other: Self) -> SelfThe bitwise and (&) of the bits in self and other.
pub const fn union(self, other: Self) -> SelfThe bitwise or (|) of the bits in self and other.
difference
Section titled “difference”pub const fn difference(self, other: Self) -> SelfThe intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
symmetric_difference
Section titled “symmetric_difference”pub const fn symmetric_difference(self, other: Self) -> SelfThe bitwise exclusive-or (^) of the bits in self and other.
complement
Section titled “complement”pub const fn complement(self) -> SelfThe bitwise negation (!) of the bits in self, truncating the result.
pub const fn iter(&self) -> Iter<MessageFlags>Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
iter_names
Section titled “iter_names”pub const fn iter_names(&self) -> IterNames<MessageFlags>Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait implementations
Section titled “Trait implementations”Binary, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Clone, Copy, Debug, Eq, Extend<MessageFlags>, Flags, FromIterator<MessageFlags>, Hash, IntoIterator, LowerHex, Not, Octal, Ord, PartialEq, PartialOrd, PublicFlags, StructuralPartialEq, Sub, SubAssign, UpperHex