pub trait StorageProvider:
Clone
+ Send
+ Sync
+ 'static {
type File: StorageFile + 'static;
// Required methods
fn open(
&self,
path: &str,
options: OpenOptions,
) -> impl Future<Output = Result<Self::File>> + Send;
fn exists(&self, path: &str) -> impl Future<Output = Result<bool>> + Send;
fn delete(&self, path: &str) -> impl Future<Output = Result<()>> + Send;
fn rename(
&self,
from: &str,
to: &str,
) -> impl Future<Output = Result<()>> + Send;
}Expand description
Provider trait for file storage operations.
Clone allows sharing providers across multiple components efficiently.
Required Associated Types§
Sourcetype File: StorageFile + 'static
type File: StorageFile + 'static
The file type for this provider.
Required Methods§
Sourcefn open(
&self,
path: &str,
options: OpenOptions,
) -> impl Future<Output = Result<Self::File>> + Send
fn open( &self, path: &str, options: OpenOptions, ) -> impl Future<Output = Result<Self::File>> + Send
Open a file with the given options.
Sourcefn exists(&self, path: &str) -> impl Future<Output = Result<bool>> + Send
fn exists(&self, path: &str) -> impl Future<Output = Result<bool>> + Send
Check if a file exists at the given path.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl StorageProvider for TokioStorageProvider
Available on crate feature tokio-providers only.
impl StorageProvider for TokioStorageProvider
Available on crate feature
tokio-providers only.