pub trait AbstractAttachments: Sync + Send {
// Required methods
fn insert_attachment<'life0, 'life1, 'async_trait>(
&'life0 self,
attachment: &'life1 File,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<File>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn fetch_deleted_attachments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<File>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_dangling_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<File>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_file_hash_references<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_and_use_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
tag: &'life2 str,
used_for: FileUsedFor,
uploader_id: String,
) -> Pin<Box<dyn Future<Output = Result<File>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn mark_attachment_as_reported<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn mark_attachment_as_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn mark_attachments_as_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_attachment<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Methods§
Sourcefn insert_attachment<'life0, 'life1, 'async_trait>(
&'life0 self,
attachment: &'life1 File,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_attachment<'life0, 'life1, 'async_trait>(
&'life0 self,
attachment: &'life1 File,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert attachment into database.
Sourcefn fetch_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<File>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<File>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch an attachment by its id.
Sourcefn fetch_deleted_attachments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<File>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_deleted_attachments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<File>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch all deleted attachments.
Sourcefn fetch_dangling_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<File>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_dangling_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<File>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch all dangling attachments.
Sourcefn count_file_hash_references<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_file_hash_references<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count references to a given hash.
Sourcefn find_and_use_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
tag: &'life2 str,
used_for: FileUsedFor,
uploader_id: String,
) -> Pin<Box<dyn Future<Output = Result<File>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find_and_use_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
tag: &'life2 str,
used_for: FileUsedFor,
uploader_id: String,
) -> Pin<Box<dyn Future<Output = Result<File>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find an attachment by its details and mark it as used by a given parent.
Sourcefn mark_attachment_as_reported<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_attachment_as_reported<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark an attachment as having been reported.
Sourcefn mark_attachment_as_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_attachment_as_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark an attachment as having been deleted.