pub struct AttachmentStore { /* private fields */ }Expand description
Ties a blob store to the metadata table.
Implementations§
Trait Implementations§
Source§impl Attachments for AttachmentStore
impl Attachments for AttachmentStore
Source§fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
field: &'life3 str,
file: UploadedFile,
) -> Pin<Box<dyn Future<Output = Result<Attachment, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
field: &'life3 str,
file: UploadedFile,
) -> Pin<Box<dyn Future<Output = Result<Attachment, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store (or replace) the file attached to
owner_type/owner_id under
field, returning the stored metadata.Source§fn get<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
field: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Attachment>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
field: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Attachment>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
The attachment stored under a single field, if any.
Source§fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attachment>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attachment>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Every attachment for a record, across all fields.
Source§fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
storage_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
storage_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the raw bytes for a stored attachment.
Source§fn delete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
field: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
field: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Remove one field’s attachment (bytes and metadata). A no-op if absent.
Source§fn delete_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner_type: &'life1 str,
owner_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove all attachments for a record. Called when the record itself is
deleted, so blobs don’t outlive their owner.
Auto Trait Implementations§
impl !RefUnwindSafe for AttachmentStore
impl !UnwindSafe for AttachmentStore
impl Freeze for AttachmentStore
impl Send for AttachmentStore
impl Sync for AttachmentStore
impl Unpin for AttachmentStore
impl UnsafeUnpin for AttachmentStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more