Enum twilight_http::request::channel::reaction::RequestReactionType
source · 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.
Reaction of a custom emoji.
Unicode
Reaction of a unicode emoji, such as “🌈”.
Trait Implementations§
source§impl<'a> Clone for RequestReactionType<'a>
impl<'a> Clone for RequestReactionType<'a>
source§fn clone(&self) -> RequestReactionType<'a>
fn clone(&self) -> RequestReactionType<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for RequestReactionType<'a>
impl<'a> Debug for RequestReactionType<'a>
source§impl Display for RequestReactionType<'_>
impl Display for RequestReactionType<'_>
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(),
);
source§impl<'a> Hash for RequestReactionType<'a>
impl<'a> Hash for RequestReactionType<'a>
source§impl<'a> PartialEq<RequestReactionType<'a>> for RequestReactionType<'a>
impl<'a> PartialEq<RequestReactionType<'a>> for RequestReactionType<'a>
source§fn eq(&self, other: &RequestReactionType<'a>) -> bool
fn eq(&self, other: &RequestReactionType<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Copy for RequestReactionType<'a>
impl<'a> Eq for RequestReactionType<'a>
impl<'a> StructuralEq for RequestReactionType<'a>
impl<'a> StructuralPartialEq for RequestReactionType<'a>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.