[][src]Enum serenity::model::channel::ReactionType

pub enum ReactionType {
    Custom {
        animated: bool,
        id: EmojiId,
        name: Option<String>,
    },
    Unicode(String),
}

The type of a Reaction sent.

Variants

A reaction with a Guilds custom Emoji, which is unique to the guild.

Fields of Custom

Whether the emoji is animated.

The Id of the custom Emoji.

The name of the custom emoji. This is primarily used for decoration and distinguishing the emoji client-side.

A reaction with a twemoji.

Methods

impl ReactionType
[src]

Creates a data-esque display of the type. This is not very useful for displaying, as the primary client can not render it, but can be useful for debugging.

Note: This is mainly for use internally. There is otherwise most likely little use for it.

Trait Implementations

impl PartialEq<ReactionType> for ReactionType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl From<char> for ReactionType
[src]

Creates a ReactionType from a char.

Examples

Reacting to a message with an apple:

message.react('🍎')?;

impl From<Emoji> for ReactionType
[src]

Performs the conversion.

impl From<EmojiId> for ReactionType
[src]

Performs the conversion.

impl From<EmojiIdentifier> for ReactionType
[src]

Performs the conversion.

impl From<String> for ReactionType
[src]

Performs the conversion.

impl<'a> From<&'a str> for ReactionType
[src]

Creates a ReactionType from a string slice.

Examples

Creating a ReactionType from a 🍎, modeling a similar API as the rest of the library:

use serenity::model::channel::ReactionType;

fn foo<R: Into<ReactionType>>(bar: R) {
    println!("{:?}", bar.into());
}

foo("🍎");

impl Clone for ReactionType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for ReactionType
[src]

impl Debug for ReactionType
[src]

Formats the value using the given formatter. Read more

impl Display for ReactionType
[src]

Formats the reaction type, displaying the associated emoji in a way that clients can understand.

If the type is a custom emoji, then refer to the documentation for emoji's formatter on how this is displayed. Otherwise, if the type is a unicode, then the inner unicode is displayed.

impl Hash for ReactionType
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl FromStr for ReactionType
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Serialize for ReactionType
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for ReactionType
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> UnsafeAny for T where
    T: Any