pub trait StorageBackend:
Send
+ Sync
+ 'static {
// Required methods
fn file_meta<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<FileMeta>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
range: RangeSpec,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Read + Send>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn mkdir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Pluggable storage backend for libfw-server.
Required Methods§
Sourcefn file_meta<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<FileMeta>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn file_meta<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<FileMeta>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return metadata for path, or None when it does not exist.
Sourcefn read_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
range: RangeSpec,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Read + Send>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
range: RangeSpec,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Read + Send>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Open a read stream for path restricted to range.
The returned reader yields exactly range.len() bytes on success.
Sourcefn write_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Open a write stream for path according to mode.
Sourcefn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List the children of directory path (or the mount root when
path is empty).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".