pub trait CacheableMessage:
From<Message>
+ PartialEq<Message>
+ PartialEq<Self>
+ Clone
+ Debug {
// Required methods
fn reactions(&self) -> &[Reaction];
fn reactions_mut(&mut self) -> &mut [Reaction];
fn retain_reactions(&mut self, f: impl FnMut(&Reaction) -> bool);
fn clear_reactions(&mut self);
fn add_reaction(&mut self, reaction: Reaction);
fn remove_reaction(&mut self, idx: usize);
}
Expand description
Trait for a generic cached representation of a Message
.
Required Methods§
Sourcefn reactions_mut(&mut self) -> &mut [Reaction]
fn reactions_mut(&mut self) -> &mut [Reaction]
Mutable getter for reactions added to this message.
Sourcefn retain_reactions(&mut self, f: impl FnMut(&Reaction) -> bool)
fn retain_reactions(&mut self, f: impl FnMut(&Reaction) -> bool)
Retain all reactions to this message matching a predicate, removing non-matching ones.
Sourcefn clear_reactions(&mut self)
fn clear_reactions(&mut self)
Clear all reactions to this message.
Sourcefn add_reaction(&mut self, reaction: Reaction)
fn add_reaction(&mut self, reaction: Reaction)
Add a reaction to this message.
Sourcefn remove_reaction(&mut self, idx: usize)
fn remove_reaction(&mut self, idx: usize)
Remove a reaction from this message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.