Enum serenity::model::channel::ReactionType [−][src]
pub enum ReactionType { Custom { animated: bool, id: EmojiId, name: Option<String>, }, Unicode(String), }
The type of a Reaction
sent.
Variants
Custom
Fields of Custom
animated: bool | Whether the emoji is animated. |
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]
impl ReactionType
pub fn as_data(&self) -> String
[src]
pub fn as_data(&self) -> String
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]
impl Clone for ReactionType
fn clone(&self) -> ReactionType
[src]
fn clone(&self) -> ReactionType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ReactionType
[src]
impl Debug for ReactionType
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for ReactionType
[src]
impl Eq for ReactionType
impl PartialEq for ReactionType
[src]
impl PartialEq for ReactionType
fn eq(&self, other: &ReactionType) -> bool
[src]
fn eq(&self, other: &ReactionType) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ReactionType) -> bool
[src]
fn ne(&self, other: &ReactionType) -> bool
This method tests for !=
.
impl Hash for ReactionType
[src]
impl Hash for ReactionType
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'de> Deserialize<'de> for ReactionType
[src]
impl<'de> Deserialize<'de> for ReactionType
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for ReactionType
[src]
impl Serialize for ReactionType
fn serialize<S>(&self, serializer: S) -> StdResult<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> StdResult<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl From<char> for ReactionType
[src]
impl From<char> for ReactionType
fn from(ch: char) -> ReactionType
[src]
fn from(ch: char) -> ReactionType
Creates a ReactionType
from a char
.
Examples
Reacting to a message with an apple:
message.react('🍎')?;
impl From<Emoji> for ReactionType
[src]
impl From<Emoji> for ReactionType
fn from(emoji: Emoji) -> ReactionType
[src]
fn from(emoji: Emoji) -> ReactionType
Performs the conversion.
impl From<EmojiId> for ReactionType
[src]
impl From<EmojiId> for ReactionType
fn from(emoji_id: EmojiId) -> ReactionType
[src]
fn from(emoji_id: EmojiId) -> ReactionType
Performs the conversion.
impl From<EmojiIdentifier> for ReactionType
[src]
impl From<EmojiIdentifier> for ReactionType
fn from(emoji_id: EmojiIdentifier) -> ReactionType
[src]
fn from(emoji_id: EmojiIdentifier) -> ReactionType
Performs the conversion.
impl From<String> for ReactionType
[src]
impl From<String> for ReactionType
fn from(unicode: String) -> ReactionType
[src]
fn from(unicode: String) -> ReactionType
Performs the conversion.
impl<'a> From<&'a str> for ReactionType
[src]
impl<'a> From<&'a str> for ReactionType
fn from(unicode: &str) -> ReactionType
[src]
fn from(unicode: &str) -> ReactionType
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::channel::ReactionType; fn foo<R: Into<ReactionType>>(bar: R) { println!("{:?}", bar.into()); } foo("🍎");
impl FromStr for ReactionType
[src]
impl FromStr for ReactionType
type Err = NeverFails
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a string s
to return a value of this type. Read more
impl Display for ReactionType
[src]
impl Display for ReactionType
fn fmt(&self, f: &mut Formatter) -> FmtResult
[src]
fn fmt(&self, f: &mut Formatter) -> FmtResult
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.
Auto Trait Implementations
impl Send for ReactionType
impl Send for ReactionType
impl Sync for ReactionType
impl Sync for ReactionType