Struct twilight_mention::fmt::MentionFormat
source · pub struct MentionFormat<T>(/* private fields */);
Expand description
Formatter to mention a resource that implements std::fmt::Display
.
§Examples
Mention a Id<UserMarker>
:
use twilight_mention::Mention;
use twilight_model::id::{marker::UserMarker, Id};
assert_eq!("<@123>", Id::<UserMarker>::new(123).mention().to_string());
Trait Implementations§
source§impl<T: Clone> Clone for MentionFormat<T>
impl<T: Clone> Clone for MentionFormat<T>
source§fn clone(&self) -> MentionFormat<T>
fn clone(&self) -> MentionFormat<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for MentionFormat<T>
impl<T: Debug> Debug for MentionFormat<T>
source§impl Display for MentionFormat<CommandMention>
impl Display for MentionFormat<CommandMention>
Mention a command. This will format as:
</NAME:COMMAND_ID>
for commands</NAME SUBCOMMAND:ID>
for subcommands</NAME SUBCOMMAND_GROUP SUBCOMMAND:ID>
for subcommand groups
source§impl Display for MentionFormat<Id<ChannelMarker>>
impl Display for MentionFormat<Id<ChannelMarker>>
Mention a channel. This will format as <#ID>
.
source§impl Display for MentionFormat<Id<EmojiMarker>>
impl Display for MentionFormat<Id<EmojiMarker>>
Mention an emoji. This will format as <:emoji:ID>
.
source§impl Display for MentionFormat<Id<RoleMarker>>
impl Display for MentionFormat<Id<RoleMarker>>
Mention a role. This will format as <@&ID>
.
source§impl Display for MentionFormat<Id<UserMarker>>
impl Display for MentionFormat<Id<UserMarker>>
Mention a user. This will format as <@ID>
.
source§impl Display for MentionFormat<Timestamp>
impl Display for MentionFormat<Timestamp>
Mention a user. This will format as <t:UNIX>
if a style is not specified or
<t:UNIX:STYLE>
if a style is specified.
source§impl<T: PartialEq> PartialEq for MentionFormat<T>
impl<T: PartialEq> PartialEq for MentionFormat<T>
source§fn eq(&self, other: &MentionFormat<T>) -> bool
fn eq(&self, other: &MentionFormat<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Copy> Copy for MentionFormat<T>
impl<T: Eq> Eq for MentionFormat<T>
impl<T> StructuralPartialEq for MentionFormat<T>
Auto Trait Implementations§
impl<T> Freeze for MentionFormat<T>where
T: Freeze,
impl<T> RefUnwindSafe for MentionFormat<T>where
T: RefUnwindSafe,
impl<T> Send for MentionFormat<T>where
T: Send,
impl<T> Sync for MentionFormat<T>where
T: Sync,
impl<T> Unpin for MentionFormat<T>where
T: Unpin,
impl<T> UnwindSafe for MentionFormat<T>where
T: 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