pub async fn create_backend(
config: &StorageConfig,
) -> StorageResult<Box<dyn StorageBackend>>Expand description
Creates a storage backend from a StorageConfig.
S3-compatible providers (s3, r2, hetzner, scaleway, ovh, exoscale,
backblaze) all use S3StorageBackend under the hood. Provider-specific
defaults for the endpoint URL are applied when endpoint is not set in the
config.
ยงErrors
Returns FileError::Storage if the backend type is unknown, the required
feature is not enabled, or required configuration fields are missing.