pub struct Reactions {
reactions: BTreeMap<ContactId, Reaction>,
}
Expand description
Structure representing all reactions to a particular message.
Fields§
§reactions: BTreeMap<ContactId, Reaction>
Map from a contact to its reaction to message.
Implementations§
source§impl Reactions
impl Reactions
sourcepub fn contacts(&self) -> Vec<ContactId>
pub fn contacts(&self) -> Vec<ContactId>
Returns vector of contacts that reacted to the message.
sourcepub fn get(&self, contact_id: ContactId) -> Reaction
pub fn get(&self, contact_id: ContactId) -> Reaction
Returns reaction of a given contact to message.
If contact did not react to message or removed the reaction, this method returns an empty reaction.
sourcepub fn emoji_frequencies(&self) -> BTreeMap<String, usize>
pub fn emoji_frequencies(&self) -> BTreeMap<String, usize>
Returns a map from emojis to their frequencies.
sourcepub fn emoji_sorted_by_frequency(&self) -> Vec<(String, usize)>
pub fn emoji_sorted_by_frequency(&self) -> Vec<(String, usize)>
Returns a vector of emojis sorted in descending order of frequencies.
This function can be used to display the reactions in the message bubble in the UIs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reactions
impl RefUnwindSafe for Reactions
impl Send for Reactions
impl Sync for Reactions
impl Unpin for Reactions
impl UnwindSafe for Reactions
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
Mutably borrows from an owned value. Read more