pub struct Mention {
pub avatar: 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.
bot: bool
Whether the user is a bot.
discriminator: u16
Discriminator 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: String
Username of the user.
public_flags: UserFlags
Public 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 Freeze for Mention
impl RefUnwindSafe for Mention
impl Send for Mention
impl Sync for Mention
impl Unpin for Mention
impl UnwindSafe for Mention
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)