pub enum RequestReactionType<'a> {
    Custom {
        id: Id<EmojiMarker>,
        name: Option<&'a str>,
    },
    Unicode {
        name: &'a str,
    },
}
Expand description

Handle a reaction of either a custom or unicode emoji.

Variants

Custom

Fields

id: Id<EmojiMarker>

ID of the custom emoji.

name: Option<&'a str>

Name of the custom emoji.

This is not strictly required, but may be helpful for Discord to work with.

Reaction of a custom emoji.

Unicode

Fields

name: &'a str

Unicode emoji.

Reaction of a unicode emoji, such as “🌈”.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Format a RequestReactionType into a format acceptable for use in URLs.

Examples

Format a custom reaction for use in a URL:

use twilight_http::request::channel::reaction::RequestReactionType;
use twilight_model::id::Id;

let reaction = RequestReactionType::Custom {
    id: Id::new(123),
    name: Some("rarity"),
};

assert_eq!("rarity:123", reaction.to_string());

Format the transgeneder flag for use in a URL:

use twilight_http::request::channel::reaction::RequestReactionType;

let reaction = RequestReactionType::Unicode {
    name: "🏳️‍⚧️"
};

assert_eq!(
    "%F0%9F%8F%B3%EF%B8%8F%E2%80%8D%E2%9A%A7%EF%B8%8F",
    reaction.to_string(),
);

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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