pub trait FileStore:
Send
+ Sync
+ 'static {
// Required methods
fn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
content: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for storing, retrieving, and deleting raw binary files.
Required Methods§
Sourcefn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
content: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
content: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Saves raw bytes under the specified collection and unique file identifier.
Sourcefn get_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves raw bytes by its identifier.
Sourcefn delete_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 str,
file_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Deletes a file.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".