AbstractAttachments

Trait AbstractAttachments 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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,

Mark multiple attachments as having been deleted.

Source

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,

Delete the attachment entry.

Implementors§