Trait opendal::Configurator
source · pub trait Configurator: Serialize + DeserializeOwned + Debug + 'static {
type Builder: Builder;
// Required method
fn into_builder(self) -> Self::Builder;
// Provided method
fn from_iter(
iter: impl IntoIterator<Item = (String, String)>,
) -> Result<Self> { ... }
}
Expand description
Configurator is used to configure the underlying service.
This trait allows the developer to define a configuration struct that can:
- deserialize from an iterator like hashmap or vector.
- convert into a service builder and finally build the underlying services.
Usually, users don’t need to use or import this trait directly, they can use Operator
API instead.
For example:
use std::collections::HashMap;
use opendal::services::MemoryConfig;
use opendal::Operator;
async fn test() -> Result<()> {
let mut cfg = MemoryConfig::default();
cfg.root = Some("/".to_string());
// Build an `Operator` to start operating the storage.
let op: Operator = Operator::from_config(cfg)?.finish();
Ok(())
}
Some service builder might contain in memory options like http_client
. Users can call
into_builder
to convert the configuration into a builder instead.
use std::collections::HashMap;
use opendal::raw::HttpClient;
use opendal::services::S3Config;
use opendal::Configurator;
use opendal::Operator;
async fn test() -> Result<()> {
let mut cfg = S3Config::default();
cfg.root = Some("/".to_string());
cfg.bucket = "test".to_string();
let builder = cfg.into_builder();
let builder = builder.http_client(HttpClient::new()?);
// Build an `Operator` to start operating the storage.
let op: Operator = Operator::new(builder)?.finish();
Ok(())
}
Required Associated Types§
Required Methods§
sourcefn into_builder(self) -> Self::Builder
fn into_builder(self) -> Self::Builder
Convert this configuration into a service builder.
Provided Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
Implementors§
source§impl Configurator for AliyunDriveConfig
Available on crate feature services-aliyun-drive
only.
impl Configurator for AliyunDriveConfig
Available on crate feature
services-aliyun-drive
only.type Builder = AliyunDriveBuilder
source§impl Configurator for AlluxioConfig
Available on crate feature services-alluxio
only.
impl Configurator for AlluxioConfig
Available on crate feature
services-alluxio
only.type Builder = AlluxioBuilder
source§impl Configurator for AtomicserverConfig
Available on crate feature services-atomicserver
only.
impl Configurator for AtomicserverConfig
Available on crate feature
services-atomicserver
only.type Builder = AtomicserverBuilder
source§impl Configurator for AzblobConfig
Available on crate feature services-azblob
only.
impl Configurator for AzblobConfig
Available on crate feature
services-azblob
only.type Builder = AzblobBuilder
source§impl Configurator for AzdlsConfig
Available on crate feature services-azdls
only.
impl Configurator for AzdlsConfig
Available on crate feature
services-azdls
only.type Builder = AzdlsBuilder
source§impl Configurator for AzfileConfig
Available on crate feature services-azfile
only.
impl Configurator for AzfileConfig
Available on crate feature
services-azfile
only.type Builder = AzfileBuilder
source§impl Configurator for B2Config
Available on crate feature services-b2
only.
impl Configurator for B2Config
Available on crate feature
services-b2
only.source§impl Configurator for CacacheConfig
Available on crate feature services-cacache
only.
impl Configurator for CacacheConfig
Available on crate feature
services-cacache
only.type Builder = CacacheBuilder
source§impl Configurator for ChainsafeConfig
Available on crate feature services-chainsafe
only.
impl Configurator for ChainsafeConfig
Available on crate feature
services-chainsafe
only.type Builder = ChainsafeBuilder
source§impl Configurator for CloudflareKvConfig
Available on crate feature services-cloudflare-kv
only.
impl Configurator for CloudflareKvConfig
Available on crate feature
services-cloudflare-kv
only.type Builder = CloudflareKvBuilder
source§impl Configurator for CompfsConfig
Available on crate feature services-compfs
only.
impl Configurator for CompfsConfig
Available on crate feature
services-compfs
only.type Builder = CompfsBuilder
source§impl Configurator for CosConfig
Available on crate feature services-cos
only.
impl Configurator for CosConfig
Available on crate feature
services-cos
only.type Builder = CosBuilder
source§impl Configurator for D1Config
Available on crate feature services-d1
only.
impl Configurator for D1Config
Available on crate feature
services-d1
only.source§impl Configurator for DashmapConfig
Available on crate feature services-dashmap
only.
impl Configurator for DashmapConfig
Available on crate feature
services-dashmap
only.type Builder = DashmapBuilder
source§impl Configurator for DbfsConfig
Available on crate feature services-dbfs
only.
impl Configurator for DbfsConfig
Available on crate feature
services-dbfs
only.type Builder = DbfsBuilder
source§impl Configurator for DropboxConfig
Available on crate feature services-dropbox
only.
impl Configurator for DropboxConfig
Available on crate feature
services-dropbox
only.type Builder = DropboxBuilder
source§impl Configurator for EtcdConfig
Available on crate feature services-etcd
only.
impl Configurator for EtcdConfig
Available on crate feature
services-etcd
only.type Builder = EtcdBuilder
source§impl Configurator for FoundationdbConfig
Available on crate feature services-foundationdb
only.
impl Configurator for FoundationdbConfig
Available on crate feature
services-foundationdb
only.type Builder = FoundationdbBuilder
source§impl Configurator for FsConfig
Available on crate feature services-fs
only.
impl Configurator for FsConfig
Available on crate feature
services-fs
only.source§impl Configurator for FtpConfig
Available on crate feature services-ftp
only.
impl Configurator for FtpConfig
Available on crate feature
services-ftp
only.type Builder = FtpBuilder
source§impl Configurator for GcsConfig
Available on crate feature services-gcs
only.
impl Configurator for GcsConfig
Available on crate feature
services-gcs
only.type Builder = GcsBuilder
source§impl Configurator for GdriveConfig
Available on crate feature services-gdrive
only.
impl Configurator for GdriveConfig
Available on crate feature
services-gdrive
only.type Builder = GdriveBuilder
source§impl Configurator for GhacConfig
Available on crate feature services-ghac
only.
impl Configurator for GhacConfig
Available on crate feature
services-ghac
only.type Builder = GhacBuilder
source§impl Configurator for GithubConfig
Available on crate feature services-github
only.
impl Configurator for GithubConfig
Available on crate feature
services-github
only.type Builder = GithubBuilder
source§impl Configurator for GridfsConfig
Available on crate feature services-gridfs
only.
impl Configurator for GridfsConfig
Available on crate feature
services-gridfs
only.type Builder = GridfsBuilder
source§impl Configurator for HdfsConfig
Available on crate feature services-hdfs
only.
impl Configurator for HdfsConfig
Available on crate feature
services-hdfs
only.type Builder = HdfsBuilder
source§impl Configurator for HdfsNativeConfig
Available on crate feature services-hdfs-native
only.
impl Configurator for HdfsNativeConfig
Available on crate feature
services-hdfs-native
only.Hadoop Distributed File System (HDFS™) support. Using Native Rust HDFS client.
type Builder = HdfsNativeBuilder
source§impl Configurator for HttpConfig
Available on crate feature services-http
only.
impl Configurator for HttpConfig
Available on crate feature
services-http
only.type Builder = HttpBuilder
source§impl Configurator for HuggingfaceConfig
Available on crate feature services-huggingface
only.
impl Configurator for HuggingfaceConfig
Available on crate feature
services-huggingface
only.type Builder = HuggingfaceBuilder
source§impl Configurator for IcloudConfig
Available on crate feature services-icloud
only.
impl Configurator for IcloudConfig
Available on crate feature
services-icloud
only.type Builder = IcloudBuilder
source§impl Configurator for IpfsConfig
Available on crate feature services-ipfs
only.
impl Configurator for IpfsConfig
Available on crate feature
services-ipfs
only.type Builder = IpfsBuilder
source§impl Configurator for IpmfsConfig
Available on crate feature services-ipmfs
only.
impl Configurator for IpmfsConfig
Available on crate feature
services-ipmfs
only.type Builder = IpmfsBuilder
source§impl Configurator for KoofrConfig
Available on crate feature services-koofr
only.
impl Configurator for KoofrConfig
Available on crate feature
services-koofr
only.type Builder = KoofrBuilder
source§impl Configurator for LakefsConfig
Available on crate feature services-lakefs
only.
impl Configurator for LakefsConfig
Available on crate feature
services-lakefs
only.type Builder = LakefsBuilder
source§impl Configurator for LibsqlConfig
Available on crate feature services-libsql
only.
impl Configurator for LibsqlConfig
Available on crate feature
services-libsql
only.type Builder = LibsqlBuilder
source§impl Configurator for MemcachedConfig
Available on crate feature services-memcached
only.
impl Configurator for MemcachedConfig
Available on crate feature
services-memcached
only.type Builder = MemcachedBuilder
source§impl Configurator for MemoryConfig
Available on crate feature services-memory
only.
impl Configurator for MemoryConfig
Available on crate feature
services-memory
only.type Builder = MemoryBuilder
source§impl Configurator for MiniMokaConfig
Available on crate feature services-mini-moka
only.
impl Configurator for MiniMokaConfig
Available on crate feature
services-mini-moka
only.type Builder = MiniMokaBuilder
source§impl Configurator for MokaConfig
Available on crate feature services-moka
only.
impl Configurator for MokaConfig
Available on crate feature
services-moka
only.type Builder = MokaBuilder
source§impl Configurator for MongodbConfig
Available on crate feature services-mongodb
only.
impl Configurator for MongodbConfig
Available on crate feature
services-mongodb
only.type Builder = MongodbBuilder
source§impl Configurator for MonoiofsConfig
Available on crate feature services-monoiofs
only.
impl Configurator for MonoiofsConfig
Available on crate feature
services-monoiofs
only.type Builder = MonoiofsBuilder
source§impl Configurator for MysqlConfig
Available on crate feature services-mysql
only.
impl Configurator for MysqlConfig
Available on crate feature
services-mysql
only.type Builder = MysqlBuilder
source§impl Configurator for NebulaGraphConfig
Available on crate feature services-nebula-graph
only.
impl Configurator for NebulaGraphConfig
Available on crate feature
services-nebula-graph
only.type Builder = NebulaGraphBuilder
source§impl Configurator for ObsConfig
Available on crate feature services-obs
only.
impl Configurator for ObsConfig
Available on crate feature
services-obs
only.type Builder = ObsBuilder
source§impl Configurator for OnedriveConfig
Available on crate feature services-onedrive
only.
impl Configurator for OnedriveConfig
Available on crate feature
services-onedrive
only.type Builder = OnedriveBuilder
source§impl Configurator for OssConfig
Available on crate feature services-oss
only.
impl Configurator for OssConfig
Available on crate feature
services-oss
only.type Builder = OssBuilder
source§impl Configurator for PcloudConfig
Available on crate feature services-pcloud
only.
impl Configurator for PcloudConfig
Available on crate feature
services-pcloud
only.type Builder = PcloudBuilder
source§impl Configurator for PersyConfig
Available on crate feature services-persy
only.
impl Configurator for PersyConfig
Available on crate feature
services-persy
only.type Builder = PersyBuilder
source§impl Configurator for PostgresqlConfig
Available on crate feature services-postgresql
only.
impl Configurator for PostgresqlConfig
Available on crate feature
services-postgresql
only.type Builder = PostgresqlBuilder
source§impl Configurator for RedbConfig
Available on crate feature services-redb
only.
impl Configurator for RedbConfig
Available on crate feature
services-redb
only.type Builder = RedbBuilder
source§impl Configurator for RedisConfig
Available on crate feature services-redis
only.
impl Configurator for RedisConfig
Available on crate feature
services-redis
only.type Builder = RedisBuilder
source§impl Configurator for RocksdbConfig
Available on crate feature services-rocksdb
only.
impl Configurator for RocksdbConfig
Available on crate feature
services-rocksdb
only.type Builder = RocksdbBuilder
source§impl Configurator for S3Config
Available on crate feature services-s3
only.
impl Configurator for S3Config
Available on crate feature
services-s3
only.source§impl Configurator for SeafileConfig
Available on crate feature services-seafile
only.
impl Configurator for SeafileConfig
Available on crate feature
services-seafile
only.type Builder = SeafileBuilder
source§impl Configurator for SftpConfig
Available on crate feature services-sftp
only.
impl Configurator for SftpConfig
Available on crate feature
services-sftp
only.type Builder = SftpBuilder
source§impl Configurator for SledConfig
Available on crate feature services-sled
only.
impl Configurator for SledConfig
Available on crate feature
services-sled
only.type Builder = SledBuilder
source§impl Configurator for SqliteConfig
Available on crate feature services-sqlite
only.
impl Configurator for SqliteConfig
Available on crate feature
services-sqlite
only.type Builder = SqliteBuilder
source§impl Configurator for SupabaseConfig
Available on crate feature services-supabase
only.
impl Configurator for SupabaseConfig
Available on crate feature
services-supabase
only.type Builder = SupabaseBuilder
source§impl Configurator for SurrealdbConfig
Available on crate feature services-surrealdb
only.
impl Configurator for SurrealdbConfig
Available on crate feature
services-surrealdb
only.type Builder = SurrealdbBuilder
source§impl Configurator for SwiftConfig
Available on crate feature services-swift
only.
impl Configurator for SwiftConfig
Available on crate feature
services-swift
only.type Builder = SwiftBuilder
source§impl Configurator for TikvConfig
Available on crate feature services-tikv
only.
impl Configurator for TikvConfig
Available on crate feature
services-tikv
only.type Builder = TikvBuilder
source§impl Configurator for UpyunConfig
Available on crate feature services-upyun
only.
impl Configurator for UpyunConfig
Available on crate feature
services-upyun
only.type Builder = UpyunBuilder
source§impl Configurator for VercelArtifactsConfig
Available on crate feature services-vercel-artifacts
only.
impl Configurator for VercelArtifactsConfig
Available on crate feature
services-vercel-artifacts
only.type Builder = VercelArtifactsBuilder
source§impl Configurator for VercelBlobConfig
Available on crate feature services-vercel-blob
only.
impl Configurator for VercelBlobConfig
Available on crate feature
services-vercel-blob
only.type Builder = VercelBlobBuilder
source§impl Configurator for WebdavConfig
Available on crate feature services-webdav
only.
impl Configurator for WebdavConfig
Available on crate feature
services-webdav
only.type Builder = WebdavBuilder
source§impl Configurator for WebhdfsConfig
Available on crate feature services-webhdfs
only.
impl Configurator for WebhdfsConfig
Available on crate feature
services-webhdfs
only.type Builder = WebhdfsBuilder
source§impl Configurator for YandexDiskConfig
Available on crate feature services-yandex-disk
only.
impl Configurator for YandexDiskConfig
Available on crate feature
services-yandex-disk
only.