Merge branch 'master' into webhooks
This commit is contained in:
@@ -27,6 +27,11 @@ mod users {
|
||||
pub mod user_settings;
|
||||
}
|
||||
|
||||
mod safety {
|
||||
pub mod report;
|
||||
pub mod snapshot;
|
||||
}
|
||||
|
||||
pub use admin::migrations::AbstractMigrations;
|
||||
|
||||
pub use media::attachment::AbstractAttachment;
|
||||
@@ -46,6 +51,9 @@ pub use users::bot::AbstractBot;
|
||||
pub use users::user::AbstractUser;
|
||||
pub use users::user_settings::AbstractUserSettings;
|
||||
|
||||
pub use safety::report::AbstractReport;
|
||||
pub use safety::snapshot::AbstractSnapshot;
|
||||
|
||||
pub trait AbstractDatabase:
|
||||
Sync
|
||||
+ Send
|
||||
@@ -63,5 +71,7 @@ pub trait AbstractDatabase:
|
||||
+ AbstractUser
|
||||
+ AbstractUserSettings
|
||||
+ AbstractWebhook
|
||||
+ AbstractReport
|
||||
+ AbstractSnapshot
|
||||
{
|
||||
}
|
||||
|
||||
8
crates/quark/src/traits/safety/report.rs
Normal file
8
crates/quark/src/traits/safety/report.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use crate::models::Report;
|
||||
use crate::Result;
|
||||
|
||||
#[async_trait]
|
||||
pub trait AbstractReport: Sync + Send {
|
||||
/// Insert a new report into the database
|
||||
async fn insert_report(&self, report: &Report) -> Result<()>;
|
||||
}
|
||||
8
crates/quark/src/traits/safety/snapshot.rs
Normal file
8
crates/quark/src/traits/safety/snapshot.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use crate::models::Snapshot;
|
||||
use crate::Result;
|
||||
|
||||
#[async_trait]
|
||||
pub trait AbstractSnapshot: Sync + Send {
|
||||
/// Insert a new snapshot into the database
|
||||
async fn insert_snapshot(&self, snapshot: &Snapshot) -> Result<()>;
|
||||
}
|
||||
Reference in New Issue
Block a user