Struct serenity::model::misc::Mention [−][src]
pub struct Mention(_);
Expand description
A struct that represents some way to insert a notification, link, or emoji into a message.
Display
is the primary way of utilizing a Mention
, either in a
format_args!
type of macro or with ToString::to_string()
. A
Mention
is created using Mentionable::mention()
, or with
From
/Into
.
Examples
use serenity::model::misc::Mention;
let user: UserId = 1.into();
let channel: ChannelId = 2.into();
let role: RoleId = 3.into();
assert_eq!(
"<@1> <#2> <@&3>",
format!("{} {} {}", Mention::from(user), Mention::from(channel), Mention::from(role),),
)
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Mention
impl UnwindSafe for Mention
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more