Skip to main content

StorageProviderFactory

Trait StorageProviderFactory 

Source
pub trait StorageProviderFactory: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn display_name(&self) -> &str;
    fn known_platform(&self) -> Option<StoragePlatform>;
    fn create<'life0, 'life1, 'async_trait>(
        &'life0 self,
        config: &'life1 HashMap<String, String>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StorageOps>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_config(&self, config: &HashMap<String, String>) -> Vec<String>;
    fn required_config_keys(&self) -> Vec<&str>;
}
Expand description

Factory that creates storage operation instances from configuration.

Third-party storage backends (e.g., Kafka, HDFS, proprietary systems) implement this trait to integrate with Razeri’s file management.

Required Methods§

Source

fn name(&self) -> &str

Machine-readable provider name (e.g., “s3”, “azure_blob”, “kafka”).

Source

fn display_name(&self) -> &str

Human-readable display name.

Source

fn known_platform(&self) -> Option<StoragePlatform>

Known enum variant, if this is a built-in platform.

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StorageOps>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a storage operations instance from a key-value configuration.

Source

fn validate_config(&self, config: &HashMap<String, String>) -> Vec<String>

Validate configuration without creating a connection.

Source

fn required_config_keys(&self) -> Vec<&str>

List required configuration keys.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§