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
Reaction of a custom emoji.
Fields
§
id: Id<EmojiMarker>
ID of the 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 for RequestReactionType<'a>
impl<'a> PartialEq for RequestReactionType<'a>
impl<'a> Copy for RequestReactionType<'a>
impl<'a> Eq for RequestReactionType<'a>
impl<'a> StructuralPartialEq for RequestReactionType<'a>
Auto Trait Implementations§
impl<'a> Freeze for RequestReactionType<'a>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more