pub struct Mention {
pub avatar: Option<ImageHash>,
pub banner: Option<ImageHash>,
pub bot: bool,
pub discriminator: u16,
pub id: Id<UserMarker>,
pub member: Option<PartialMember>,
pub name: String,
pub public_flags: UserFlags,
}Expand description
Mention of a user in a message.
Fields§
§avatar: Option<ImageHash>Hash of the user’s avatar, if any.
Hash of the user’s banner, if any.
bot: boolWhether the user is a bot.
discriminator: u16Discriminator used to differentiate people with the same username.
§serde
The discriminator field can be deserialized from either a string or an integer. The field will always serialize into a string due to that being the type Discord’s API uses.
id: Id<UserMarker>Unique ID of the user.
member: Option<PartialMember>Member object for the user in the guild, if available.
name: StringUsername of the user.
public_flags: UserFlagsPublic flags on the user’s account.
Implementations§
Source§impl Mention
impl Mention
Sourcepub const fn discriminator(&self) -> DiscriminatorDisplay
pub const fn discriminator(&self) -> DiscriminatorDisplay
Create a Display formatter for a user discriminator.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mention
impl<'de> Deserialize<'de> for Mention
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Mention
impl StructuralPartialEq for Mention
Auto Trait Implementations§
impl Forget for Mention
impl Freeze for Mentionwhere
PhantomData<fn(UserMarker) -> UserMarker>: Freeze,
NonZero<u64>: Freeze,
PhantomData<fn(AvatarDecorationDataSkuMarker) -> AvatarDecorationDataSkuMarker>: Freeze,
NonZero<i32>: Freeze,
InternalBitFlags: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
InternalBitFlags: Freeze,
PhantomData<Id<RoleMarker>>: Freeze,
InternalBitFlags: Freeze,
PhantomData<fn(GuildMarker) -> GuildMarker>: Freeze,
impl Move for Mention
impl RefUnwindSafe for Mentionwhere
NonZero<u64>: RefUnwindSafe,
NonZero<i32>: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
impl Send for Mention
impl Sync for Mention
impl Unpin for Mention
impl UnsafeUnpin for Mentionwhere
PhantomData<fn(UserMarker) -> UserMarker>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
PhantomData<fn(AvatarDecorationDataSkuMarker) -> AvatarDecorationDataSkuMarker>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
PhantomData<Id<RoleMarker>>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
PhantomData<fn(GuildMarker) -> GuildMarker>: UnsafeUnpin,
impl UnwindSafe for Mentionwhere
NonZero<u64>: UnwindSafe,
NonZero<i32>: UnwindSafe,
InternalBitFlags: UnwindSafe,
RawVecInner: UnwindSafe,
InternalBitFlags: UnwindSafe,
InternalBitFlags: UnwindSafe,
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