pub struct Reaction {
reaction: String,
}
Expand description
A single reaction consisting of multiple emoji sequences.
It is guaranteed to have all emojis sorted and deduplicated inside.
Fields§
§reaction: String
Canonical representation of reaction as a string of space-separated emojis.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Reaction
impl<'de> Deserialize<'de> for Reaction
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<&str> for Reaction
impl From<&str> for Reaction
source§fn from(reaction: &str) -> Self
fn from(reaction: &str) -> Self
Parses a string containing a reaction.
Reaction string is separated by spaces or tabs (WSP
in ABNF),
but this function accepts any ASCII whitespace, so even a CRLF at
the end of string is acceptable.
Any short enough string is accepted as a reaction to avoid the complexity of validating emoji sequences as required by RFC 9078. On the sender side UI is responsible to provide only valid emoji sequences via reaction picker. On the receiver side, abuse of the possibility to use arbitrary strings as reactions is not different from other kinds of spam attacks such as sending large numbers of large messages, and should be dealt with the same way, e.g. by blocking the user.
impl Eq for Reaction
impl StructuralPartialEq for Reaction
Auto Trait Implementations§
impl Freeze for Reaction
impl RefUnwindSafe for Reaction
impl Send for Reaction
impl Sync for Reaction
impl Unpin for Reaction
impl UnwindSafe for Reaction
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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)
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
§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
key
and return true
if they are equal.