INNER CODE UNIT · Rust
to_hashmap
splitgraph/seafowl · object_store_factory/src/lib.rs:71
pub fn to_hashmap(&self) -> HashMap<String, String> {
match self {
ObjectStoreConfig::Local(config) => config.to_hashmap(),
ObjectStoreConfig::AmazonS3(config) => config.to_hashmap(),
ObjectStoreConfig::GoogleCloudStorage(config) => config.to_hashmap(),
ObjectStoreConfig::Memory => HashMap::new(), // Memory config has no associated data
}
}
pub fn build_object_store(
&self,
) -> Result<Arc<dyn ObjectStore>, object_store::Error> {
match self {
ObjectStoreConfig::Memory => memory::build_in_memory_storage(),
ObjectStoreConfig::Local(local_config) => local_config.build_local_storage(),
ObjectStoreConfig::AmazonS3(aws_config) => aws_config.build_amazon_s3(),
ObjectStoreConfig::GoogleCloudStorage(google_config) => {
google_config.build_google_cloud_storage()