pub trait StorageConnection:
Send
+ Sync
+ Sized
+ 'static {
type Config: DeserializeOwned + Send + Sync;
// Required method
fn connect<'life0, 'life1, 'async_trait>(
config: Self::Config,
storage_registry: Arc<StorageRegistry>,
data_dir: &'life0 Path,
plugin_namespace: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The entry point for a generic storage adapter. It guarantees that plugins can seamlessly initialize their underlying connection using the shared StorageRegistry without requiring manual setup in main.rs.
Required Associated Types§
type Config: DeserializeOwned + Send + Sync
Required Methods§
fn connect<'life0, 'life1, 'async_trait>(
config: Self::Config,
storage_registry: Arc<StorageRegistry>,
data_dir: &'life0 Path,
plugin_namespace: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".