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::{Id, marker::UserMarker};
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 duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy> Copy for MentionFormat<T>
Source§impl<T: Debug> Debug for MentionFormat<T>
impl<T: Debug> Debug for MentionFormat<T>
Source§impl Display for MentionFormat<CommandMention>
Mention a command. This will format as:
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>>
Mention a channel. This will format as <#ID>.
impl Display for MentionFormat<Id<ChannelMarker>>
Mention a channel. This will format as <#ID>.
Source§impl Display for MentionFormat<Id<EmojiMarker>>
Mention an emoji. This will format as <:emoji:ID>.
impl Display for MentionFormat<Id<EmojiMarker>>
Mention an emoji. This will format as <:emoji:ID>.
Source§impl Display for MentionFormat<Id<RoleMarker>>
Mention a role. This will format as <@&ID>.
impl Display for MentionFormat<Id<RoleMarker>>
Mention a role. This will format as <@&ID>.
Source§impl Display for MentionFormat<Id<UserMarker>>
Mention a user. This will format as <@ID>.
impl Display for MentionFormat<Id<UserMarker>>
Mention a user. This will format as <@ID>.
Source§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.
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.
impl<T: Eq> Eq for MentionFormat<T>
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
Tests for
self and other values to be equal, and is used by ==.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> UnsafeUnpin for MentionFormat<T>where
T: UnsafeUnpin,
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