revolt_database/models/emojis/
ops.rs

1use revolt_result::Result;
2
3use crate::Emoji;
4
5#[cfg(feature = "mongodb")]
6mod mongodb;
7mod reference;
8
9#[async_trait]
10pub trait AbstractEmojis: Sync + Send {
11    /// Insert emoji into database.
12    async fn insert_emoji(&self, emoji: &Emoji) -> Result<()>;
13
14    /// Fetch an emoji by its id
15    async fn fetch_emoji(&self, id: &str) -> Result<Emoji>;
16
17    /// Fetch emoji by their parent id
18    async fn fetch_emoji_by_parent_id(&self, parent_id: &str) -> Result<Vec<Emoji>>;
19
20    /// Fetch emoji by their parent ids
21    async fn fetch_emoji_by_parent_ids(&self, parent_ids: &[String]) -> Result<Vec<Emoji>>;
22
23    /// Detach an emoji by its id
24    async fn detach_emoji(&self, emoji: &Emoji) -> Result<()>;
25}