[−][src]Enum serenity::model::channel::ReactionType
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 PartialEq<ReactionType> for ReactionType
[src]
impl PartialEq<ReactionType> 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 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 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 Eq for ReactionType
[src]
impl Eq for ReactionType
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 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.
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 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 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<'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
Auto Trait Implementations
impl Send for ReactionType
impl Send for ReactionType
impl Sync for ReactionType
impl Sync for ReactionType
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
[src]
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,