Enum twilight_http::request::channel::reaction::RequestReactionType [−][src]
pub enum RequestReactionType { Custom { id: EmojiId, name: Option<String>, }, Unicode { name: String, }, }
Expand description
Handle a reaction of either a custom or unicode emoji.
Variants
Reaction of a custom emoji.
Show fields
Reaction of a unicode emoji, such as “🌈”.
Show fields
Fields of Unicode
name: String
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: "🏳️⚧️".to_owned(), }; // 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
Performs the conversion.
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 RefUnwindSafe for RequestReactionType
impl Send for RequestReactionType
impl Sync for RequestReactionType
impl Unpin for RequestReactionType
impl UnwindSafe for RequestReactionType
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
pub fn vzip(self) -> V