[][src]Trait twilight_mention::fmt::Mention

pub trait Mention<T> {
    fn mention(&self) -> MentionFormat<T>;
}

Mention a resource, such as an emoji or user.

This will create a mention that will link to a user if it exists.

Look at the implementations list to see what you can mention.

Examples

Mention a ChannelId:

use twilight_mention::Mention;
use twilight_model::id::ChannelId;

assert_eq!("<#123>", ChannelId(123).mention().to_string());

Required methods

fn mention(&self) -> MentionFormat<T>

Mention a resource by using its ID.

Loading content...

Implementations on Foreign Types

impl Mention<ChannelId> for ChannelId[src]

Mention a channel ID. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ ChannelId[src]

Mention a channel ID. This will format as <#ID>.

impl Mention<ChannelId> for CategoryChannel[src]

Mention a guild category channel. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ CategoryChannel[src]

Mention a guild category channel. This will format as <#ID>.

impl Mention<ChannelId> for Channel[src]

Mention a channel. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ Channel[src]

Mention a channel. This will format as <#ID>.

impl Mention<UserId> for CurrentUser[src]

Mention the current user. This will format as <@ID>.

impl<'_> Mention<UserId> for &'_ CurrentUser[src]

Mention the current user. This will format as <@ID>.

impl Mention<EmojiId> for EmojiId[src]

Mention an emoji. This will format as <:emoji:ID>.

impl<'_> Mention<EmojiId> for &'_ EmojiId[src]

Mention an emoji. This will format as <:emoji:ID>.

impl Mention<EmojiId> for Emoji[src]

Mention an emoji. This will format as <:emoji:ID>.

impl<'_> Mention<EmojiId> for &'_ Emoji[src]

Mention an emoji. This will format as <:emoji:ID>.

impl Mention<ChannelId> for Group[src]

Mention a group. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ Group[src]

Mention a group. This will format as <#ID>.

impl Mention<ChannelId> for GuildChannel[src]

Mention a guild channel. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ GuildChannel[src]

Mention a guild channel. This will format as <#ID>.

impl Mention<UserId> for Member[src]

Mention a member's user. This will format as <@ID>.

impl<'_> Mention<UserId> for &'_ Member[src]

Mention a member's user. This will format as <@ID>.

impl Mention<ChannelId> for PrivateChannel[src]

Mention a private channel. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ PrivateChannel[src]

Mention a private channel. This will format as <#ID>.

impl Mention<RoleId> for RoleId[src]

Mention a role ID. This will format as <@&ID>.

impl<'_> Mention<RoleId> for &'_ RoleId[src]

Mention a role ID. This will format as <@&ID>.

impl Mention<RoleId> for Role[src]

Mention a role ID. This will format as <@&ID>.

impl<'_> Mention<RoleId> for &'_ Role[src]

Mention a role ID. This will format as <@&ID>.

impl Mention<ChannelId> for TextChannel[src]

Mention a guild text channel. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ TextChannel[src]

Mention a guild text channel. This will format as <#ID>.

impl Mention<UserId> for UserId[src]

Mention a user ID. This will format as <&ID>.

impl<'_> Mention<UserId> for &'_ UserId[src]

Mention a user ID. This will format as <&ID>.

impl Mention<UserId> for User[src]

Mention a user. This will format as <&ID>.

impl<'_> Mention<UserId> for &'_ User[src]

Mention a user. This will format as <&ID>.

impl Mention<ChannelId> for VoiceChannel[src]

Mention a guild voice channel. This will format as <#ID>.

impl<'_> Mention<ChannelId> for &'_ VoiceChannel[src]

Mention a guild voice channel. This will format as <#ID>.

Loading content...

Implementors

Loading content...