pub trait StorageProvider: Send + Sync {
// Required methods
fn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
building_id: Uuid,
filename: &'life1 str,
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_file<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn file_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Abstraction over the document storage backend.
Required Methods§
Sourcefn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
building_id: Uuid,
filename: &'life1 str,
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, 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,
building_id: Uuid,
filename: &'life1 str,
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persist a file and return the relative path that can later be used to read/delete it.
Sourcefn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve the raw bytes and return them as a vector.