pub trait CatalogBuilder:
Default
+ Debug
+ Send
+ Sync {
type C: Catalog;
// Required methods
fn with_storage_factory(
self,
storage_factory: Arc<dyn StorageFactory>,
) -> Self;
fn load(
self,
name: impl Into<String>,
props: HashMap<String, String>,
) -> impl Future<Output = Result<Self::C>> + Send;
}Expand description
Common interface for all catalog builders.
Required Associated Types§
Required Methods§
Sourcefn with_storage_factory(self, storage_factory: Arc<dyn StorageFactory>) -> Self
fn with_storage_factory(self, storage_factory: Arc<dyn StorageFactory>) -> Self
Set a custom StorageFactory to use for storage operations.
When a StorageFactory is provided, the catalog will use it to build FileIO instances for all storage operations instead of using the default factory.
§Arguments
storage_factory- The StorageFactory to use for creating storage instances
§Example
ⓘ
use iceberg::CatalogBuilder;
use iceberg::io::StorageFactory;
use iceberg_storage_opendal::OpenDalStorageFactory;
use std::sync::Arc;
let catalog = MyCatalogBuilder::default()
.with_storage_factory(Arc::new(OpenDalStorageFactory::S3 {
configured_scheme: "s3a".to_string(),
customized_credential_load: None,
}))
.load("my_catalog", props)
.await?;Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.