pub trait StorageFactory:
Debug
+ Send
+ Sync
+ Serialize
+ Deserialize {
// Required method
fn build(&self, config: &StorageConfig) -> Result<Arc<dyn Storage>>;
}Expand description
Factory for creating Storage instances from configuration.
Implement this trait to provide custom storage backends. The factory pattern allows for lazy initialization of storage instances and enables users to inject custom storage implementations into catalogs.
§Example
ⓘ
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
struct MyCustomStorageFactory {
// custom configuration
}
#[typetag::serde]
impl StorageFactory for MyCustomStorageFactory {
fn build(&self, config: &StorageConfig) -> Result<Arc<dyn Storage>> {
// Create and return custom storage implementation
todo!()
}
}
TODO remove below when the trait is integrated with FileIO and Catalog
This trait is under heavy development and is not used anywhere as of now
Please DO NOT implement it