revolt_database/models/channel_invites/
ops.rs

1use revolt_result::Result;
2
3use crate::Invite;
4
5#[cfg(feature = "mongodb")]
6mod mongodb;
7mod reference;
8
9#[async_trait]
10pub trait AbstractChannelInvites: Sync + Send {
11    /// Insert a new invite into the database
12    async fn insert_invite(&self, invite: &Invite) -> Result<()>;
13
14    /// Fetch an invite by its id
15    async fn fetch_invite(&self, code: &str) -> Result<Invite>;
16
17    /// Fetch all invites for a server
18    async fn fetch_invites_for_server(&self, server_id: &str) -> Result<Vec<Invite>>;
19
20    /// Delete an invite by its id
21    async fn delete_invite(&self, code: &str) -> Result<()>;
22}