Enum twilight_http::request::channel::reaction::RequestReactionType [−][src]
pub enum RequestReactionType<'a> { Custom { id: EmojiId, name: Option<&'a str>, }, Unicode { name: &'a str, }, }
Expand description
Handle a reaction of either a custom or unicode emoji.
Variants
Reaction of a custom emoji.
Fields of Custom
Reaction of a unicode emoji, such as “🌈”.
Fields of Unicode
name: &'a str
Unicode emoji.
Implementations
Create a display formatter for a reaction type resulting in a format acceptable for use in URLs.
Examples
Format the transgender flag for use in a URL:
use twilight_http::request::channel::reaction::RequestReactionType; use twilight_model::id::EmojiId; let reaction = RequestReactionType::Unicode { name: "🏳️⚧️", }; // Retrieve the display formatter. let display = reaction.display(); // And now format it into a percent-encoded string and then check it. assert_eq!( "%F0%9F%8F%B3%EF%B8%8F%E2%80%8D%E2%9A%A7%EF%B8%8F", display.to_string(), );
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for RequestReactionType<'a>
impl<'a> Send for RequestReactionType<'a>
impl<'a> Sync for RequestReactionType<'a>
impl<'a> Unpin for RequestReactionType<'a>
impl<'a> UnwindSafe for RequestReactionType<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more