Enum serenity::model::ReactionType
[−]
[src]
pub enum ReactionType { Custom { id: EmojiId, name: Option<String>, }, Unicode(String), }
The type of a Reaction
sent.
Variants
Custom
Fields of Custom
id: EmojiId | The Id of the custom |
name: Option<String> | The name of the custom emoji. This is primarily used for decoration and distinguishing the emoji client-side. |
Unicode(String)
A reaction with a twemoji.
Methods
impl ReactionType
[src]
fn as_data(&self) -> String
[src]
Creates a data-esque display of the type. This is not very useful for displaying, as the primary client can not render it, but can be useful for debugging.
Note: This is mainly for use internally. There is otherwise most likely little use for it.
Trait Implementations
impl Clone for ReactionType
[src]
fn clone(&self) -> ReactionType
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ReactionType
[src]
impl Eq for ReactionType
[src]
impl PartialEq for ReactionType
[src]
fn eq(&self, __arg_0: &ReactionType) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ReactionType) -> bool
[src]
This method tests for !=
.
impl Hash for ReactionType
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'de> Deserialize<'de> for ReactionType
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
[src]
deserializer: D
) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl From<char> for ReactionType
[src]
fn from(ch: char) -> ReactionType
[src]
Creates a ReactionType
from a char
.
Examples
Reacting to a message with an apple:
message.react('🍎')?;
impl From<Emoji> for ReactionType
[src]
fn from(emoji: Emoji) -> ReactionType
[src]
Performs the conversion.
impl From<String> for ReactionType
[src]
fn from(unicode: String) -> ReactionType
[src]
Performs the conversion.
impl<'a> From<&'a str> for ReactionType
[src]
fn from(unicode: &str) -> ReactionType
[src]
Creates a ReactionType
from a string slice.
Examples
Creating a ReactionType
from a 🍎
, modeling a similar API as the
rest of the library:
use serenity::model::ReactionType; fn foo<R: Into<ReactionType>>(bar: R) { println!("{:?}", bar.into()); } foo("🍎");
impl Display for ReactionType
[src]
fn fmt(&self, f: &mut Formatter) -> FmtResult
[src]
Formats the reaction type, displaying the associated emoji in a way that clients can understand.
If the type is a custom emoji, then refer to the documentation for emoji's formatter on how this is displayed. Otherwise, if the type is a unicode, then the inner unicode is displayed.