feat(safety): fetch reports and fetch snapshot API

This commit is contained in:
Paul Makles
2023-03-01 11:22:22 +00:00
parent 42b4906594
commit 304336d905
13 changed files with 93 additions and 4 deletions

View File

@@ -5,4 +5,7 @@ use crate::Result;
pub trait AbstractReport: Sync + Send {
/// Insert a new report into the database
async fn insert_report(&self, report: &Report) -> Result<()>;
/// Fetch reports
async fn fetch_reports(&self) -> Result<Vec<Report>>;
}

View File

@@ -5,4 +5,7 @@ use crate::Result;
pub trait AbstractSnapshot: Sync + Send {
/// Insert a new snapshot into the database
async fn insert_snapshot(&self, snapshot: &Snapshot) -> Result<()>;
/// Fetch a snapshot by a report's id
async fn fetch_snapshot(&self, report_id: &str) -> Result<Snapshot>;
}