[−][src]Enum serenity::model::channel::ReactionType
The type of a Reaction
sent.
Variants (Non-exhaustive)
Fields of Custom
Unicode(String)
A reaction with a twemoji.
Implementations
impl ReactionType
[src]
pub 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]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ReactionType
[src]
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>
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.
impl Eq for ReactionType
[src]
impl From<Emoji> for ReactionType
[src]
fn from(emoji: Emoji) -> ReactionType
[src]
impl From<EmojiId> for ReactionType
[src]
fn from(emoji_id: EmojiId) -> ReactionType
[src]
impl From<EmojiIdentifier> for ReactionType
[src]
fn from(emoji_id: EmojiIdentifier) -> ReactionType
[src]
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(ctx, '🍎').await?;
impl FromStr for ReactionType
[src]
type Err = ReactionConversionError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for ReactionType
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ReactionType> for ReactionType
[src]
fn eq(&self, other: &ReactionType) -> bool
[src]
fn ne(&self, other: &ReactionType) -> bool
[src]
impl Serialize for ReactionType
[src]
impl StructuralEq for ReactionType
[src]
impl StructuralPartialEq for ReactionType
[src]
impl<'a> TryFrom<&'a str> for ReactionType
[src]
type Error = ReactionConversionError
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; use std::convert::TryInto; use std::fmt::Debug; fn foo<R: TryInto<ReactionType>>(bar: R) where R::Error: Debug { println!("{:?}", bar.try_into().unwrap()); } foo("🍎");
Creating a ReactionType
from a custom emoji argument in the following format:
use serenity::model::channel::ReactionType; use serenity::model::id::EmojiId; use std::convert::TryFrom; let emoji_string = "<:customemoji:600404340292059257>"; let reaction = ReactionType::try_from(emoji_string).unwrap(); let reaction2 = ReactionType::Custom { animated: false, id: EmojiId(600404340292059257), name: Some("customemoji".to_string()), }; assert_eq!(reaction, reaction2);
fn try_from(emoji_str: &str) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for ReactionType
[src]
Auto Trait Implementations
impl RefUnwindSafe for ReactionType
impl Send for ReactionType
impl Sync for ReactionType
impl Unpin for ReactionType
impl UnwindSafe for ReactionType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<F> FromStrAndCache for F where
F: FromStr,
[src]
F: FromStr,
type Err = <F as FromStr>::Err
fn from_str<'life0, 'async_trait, CRL>(
CRL,
&'life0 str
) -> Pin<Box<dyn Future<Output = Result<F, <F as FromStrAndCache>::Err>> + 'async_trait + Send>> where
'life0: 'async_trait,
CRL: AsRef<Cache> + Send + Sync + 'async_trait,
F: 'async_trait,
[src]
CRL,
&'life0 str
) -> Pin<Box<dyn Future<Output = Result<F, <F as FromStrAndCache>::Err>> + 'async_trait + Send>> where
'life0: 'async_trait,
CRL: AsRef<Cache> + Send + Sync + 'async_trait,
F: 'async_trait,
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,