#[non_exhaustive]pub enum AllowedMentionType {
Roles,
Users,
Everyone,
Unknown(CompactString),
}Expand description
discord.js counterpart: AllowedMentionsTypes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Roles
Role mentions.
Users
User mentions.
Everyone
@everyone and @here.
Unknown(CompactString)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
AllowedMentionType::from over constructing this variant directly.
Implementations§
Source§impl AllowedMentionType
impl AllowedMentionType
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the string Discord uses for this value.
discord.js counterpart: the enum’s string value in discord-api-types.
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true for a value this version of the library does not know about.
discord.js counterpart: none (discord.js passes unknown strings through).
Trait Implementations§
Source§impl AsRef<str> for AllowedMentionType
impl AsRef<str> for AllowedMentionType
Source§impl Clone for AllowedMentionType
impl Clone for AllowedMentionType
Source§impl Debug for AllowedMentionType
impl Debug for AllowedMentionType
Source§impl<'de> Deserialize<'de> for AllowedMentionType
impl<'de> Deserialize<'de> for AllowedMentionType
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AllowedMentionType
impl Display for AllowedMentionType
impl Eq for AllowedMentionType
Source§impl From<&str> for AllowedMentionType
impl From<&str> for AllowedMentionType
Source§impl Hash for AllowedMentionType
impl Hash for AllowedMentionType
Source§impl Ord for AllowedMentionType
impl Ord for AllowedMentionType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for AllowedMentionType
impl PartialEq for AllowedMentionType
Source§impl PartialOrd for AllowedMentionType
impl PartialOrd for AllowedMentionType
Auto Trait Implementations§
impl Forget for AllowedMentionType
impl Freeze for AllowedMentionType
impl Move for AllowedMentionType
impl RefUnwindSafe for AllowedMentionType
impl Send for AllowedMentionType
impl Sync for AllowedMentionType
impl Unpin for AllowedMentionType
impl UnsafeUnpin for AllowedMentionType
impl UnwindSafe for AllowedMentionType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more