opendal 0.56.0

Apache OpenDALâ„¢: One Layer, All Storage.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

#![doc(
    html_logo_url = "https://raw.githubusercontent.com/apache/opendal/main/website/static/img/logo.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
//! Facade crate that re-exports all public APIs from `opendal-core` and optional services/layers.
#![deny(missing_docs)]

pub use opendal_core::*;

#[cfg(feature = "tests")]
pub extern crate opendal_testkit as tests;

/// Initialize the global [`OperatorRegistry`] with enabled services.
///
/// This function is safe to call multiple times and will only perform
/// initialization once.
///
/// # Notes
///
/// Some bindings link `opendal` as a `staticlib`, where `#[ctor::ctor]`
/// initializers may not be executed due to linker behavior. Those bindings
/// should call this function explicitly before using `Operator::from_uri` or
/// `Operator::via_iter`.
pub fn init_default_registry() {
    static DEFAULT_REGISTRY_INIT: std::sync::Once = std::sync::Once::new();
    DEFAULT_REGISTRY_INIT.call_once(|| init_default_registry_inner(OperatorRegistry::get()));
}

fn init_default_registry_inner(registry: &OperatorRegistry) {
    opendal_core::services::register_memory_service(registry);

    #[cfg(feature = "services-aliyun-drive")]
    opendal_service_aliyun_drive::register_aliyun_drive_service(registry);

    #[cfg(feature = "services-alluxio")]
    opendal_service_alluxio::register_alluxio_service(registry);

    #[cfg(feature = "services-azblob")]
    opendal_service_azblob::register_azblob_service(registry);

    #[cfg(feature = "services-azdls")]
    opendal_service_azdls::register_azdls_service(registry);

    #[cfg(feature = "services-azfile")]
    opendal_service_azfile::register_azfile_service(registry);

    #[cfg(feature = "services-b2")]
    opendal_service_b2::register_b2_service(registry);

    #[cfg(feature = "services-cacache")]
    opendal_service_cacache::register_cacache_service(registry);

    #[cfg(feature = "services-cloudflare-kv")]
    opendal_service_cloudflare_kv::register_cloudflare_kv_service(registry);

    #[cfg(feature = "services-compfs")]
    opendal_service_compfs::register_compfs_service(registry);

    #[cfg(feature = "services-cos")]
    opendal_service_cos::register_cos_service(registry);

    #[cfg(feature = "services-d1")]
    opendal_service_d1::register_d1_service(registry);

    #[cfg(feature = "services-dashmap")]
    opendal_service_dashmap::register_dashmap_service(registry);

    #[cfg(feature = "services-dbfs")]
    opendal_service_dbfs::register_dbfs_service(registry);

    #[cfg(feature = "services-dropbox")]
    opendal_service_dropbox::register_dropbox_service(registry);

    #[cfg(feature = "services-etcd")]
    opendal_service_etcd::register_etcd_service(registry);

    #[cfg(feature = "services-foundationdb")]
    opendal_service_foundationdb::register_foundationdb_service(registry);

    #[cfg(feature = "services-foyer")]
    opendal_service_foyer::register_foyer_service(registry);

    #[cfg(feature = "services-fs")]
    opendal_service_fs::register_fs_service(registry);

    #[cfg(feature = "services-ftp")]
    opendal_service_ftp::register_ftp_service(registry);

    #[cfg(feature = "services-gcs")]
    opendal_service_gcs::register_gcs_service(registry);

    #[cfg(feature = "services-gdrive")]
    opendal_service_gdrive::register_gdrive_service(registry);

    #[cfg(feature = "services-ghac")]
    opendal_service_ghac::register_ghac_service(registry);

    #[cfg(feature = "services-github")]
    opendal_service_github::register_github_service(registry);

    #[cfg(feature = "services-gridfs")]
    opendal_service_gridfs::register_gridfs_service(registry);

    #[cfg(feature = "services-hdfs")]
    opendal_service_hdfs::register_hdfs_service(registry);

    #[cfg(feature = "services-hdfs-native")]
    opendal_service_hdfs_native::register_hdfs_native_service(registry);

    #[cfg(feature = "services-http")]
    opendal_service_http::register_http_service(registry);

    #[cfg(feature = "services-hf")]
    opendal_service_hf::register_hf_service(registry);

    #[cfg(feature = "services-ipfs")]
    opendal_service_ipfs::register_ipfs_service(registry);

    #[cfg(feature = "services-ipmfs")]
    opendal_service_ipmfs::register_ipmfs_service(registry);

    #[cfg(feature = "services-koofr")]
    opendal_service_koofr::register_koofr_service(registry);

    #[cfg(feature = "services-lakefs")]
    opendal_service_lakefs::register_lakefs_service(registry);

    #[cfg(feature = "services-memcached")]
    opendal_service_memcached::register_memcached_service(registry);

    #[cfg(feature = "services-mini-moka")]
    opendal_service_mini_moka::register_mini_moka_service(registry);

    #[cfg(feature = "services-moka")]
    opendal_service_moka::register_moka_service(registry);

    #[cfg(feature = "services-mongodb")]
    opendal_service_mongodb::register_mongodb_service(registry);

    #[cfg(feature = "services-monoiofs")]
    opendal_service_monoiofs::register_monoiofs_service(registry);

    #[cfg(feature = "services-mysql")]
    opendal_service_mysql::register_mysql_service(registry);

    #[cfg(feature = "services-obs")]
    opendal_service_obs::register_obs_service(registry);

    #[cfg(feature = "services-onedrive")]
    opendal_service_onedrive::register_onedrive_service(registry);

    #[cfg(feature = "services-oss")]
    opendal_service_oss::register_oss_service(registry);

    #[cfg(feature = "services-pcloud")]
    opendal_service_pcloud::register_pcloud_service(registry);

    #[cfg(feature = "services-persy")]
    opendal_service_persy::register_persy_service(registry);

    #[cfg(feature = "services-postgresql")]
    opendal_service_postgresql::register_postgresql_service(registry);

    #[cfg(feature = "services-redb")]
    opendal_service_redb::register_redb_service(registry);

    #[cfg(feature = "services-rocksdb")]
    opendal_service_rocksdb::register_rocksdb_service(registry);

    #[cfg(feature = "services-s3")]
    opendal_service_s3::register_s3_service(registry);

    #[cfg(feature = "services-seafile")]
    opendal_service_seafile::register_seafile_service(registry);

    #[cfg(feature = "services-sftp")]
    opendal_service_sftp::register_sftp_service(registry);

    #[cfg(feature = "services-sled")]
    opendal_service_sled::register_sled_service(registry);

    #[cfg(feature = "services-sqlite")]
    opendal_service_sqlite::register_sqlite_service(registry);

    #[cfg(feature = "services-surrealdb")]
    opendal_service_surrealdb::register_surrealdb_service(registry);

    #[cfg(feature = "services-swift")]
    opendal_service_swift::register_swift_service(registry);

    #[cfg(feature = "services-tikv")]
    opendal_service_tikv::register_tikv_service(registry);

    #[cfg(feature = "services-tos")]
    opendal_service_tos::register_tos_service(registry);

    #[cfg(feature = "services-upyun")]
    opendal_service_upyun::register_upyun_service(registry);

    #[cfg(feature = "services-vercel-artifacts")]
    opendal_service_vercel_artifacts::register_vercel_artifacts_service(registry);

    #[cfg(feature = "services-vercel-blob")]
    opendal_service_vercel_blob::register_vercel_blob_service(registry);

    #[cfg(feature = "services-webdav")]
    opendal_service_webdav::register_webdav_service(registry);

    #[cfg(feature = "services-webhdfs")]
    opendal_service_webhdfs::register_webhdfs_service(registry);

    #[cfg(feature = "services-yandex-disk")]
    opendal_service_yandex_disk::register_yandex_disk_service(registry);

    #[cfg(all(target_arch = "wasm32", feature = "services-opfs"))]
    opendal_service_opfs::register_opfs_service(registry);

    #[cfg(any(feature = "services-redis", feature = "services-redis-native-tls"))]
    opendal_service_redis::register_redis_service(registry);
}

#[cfg(feature = "auto-register-services")]
#[ctor::ctor]
fn register_default_operator_registry() {
    init_default_registry();
}

/// Re-export of service implementations.
pub mod services {
    pub use opendal_core::services::*;
    #[cfg(feature = "services-aliyun-drive")]
    pub use opendal_service_aliyun_drive::*;
    #[cfg(feature = "services-alluxio")]
    pub use opendal_service_alluxio::*;
    #[cfg(feature = "services-azblob")]
    pub use opendal_service_azblob::*;
    #[cfg(feature = "services-azdls")]
    pub use opendal_service_azdls::*;
    #[cfg(feature = "services-azfile")]
    pub use opendal_service_azfile::*;
    #[cfg(feature = "services-b2")]
    pub use opendal_service_b2::*;
    #[cfg(feature = "services-cacache")]
    pub use opendal_service_cacache::*;
    #[cfg(feature = "services-cloudflare-kv")]
    pub use opendal_service_cloudflare_kv::*;
    #[cfg(feature = "services-compfs")]
    pub use opendal_service_compfs::*;
    #[cfg(feature = "services-cos")]
    pub use opendal_service_cos::*;
    #[cfg(feature = "services-d1")]
    pub use opendal_service_d1::*;
    #[cfg(feature = "services-dashmap")]
    pub use opendal_service_dashmap::*;
    #[cfg(feature = "services-dbfs")]
    pub use opendal_service_dbfs::*;
    #[cfg(feature = "services-dropbox")]
    pub use opendal_service_dropbox::*;
    #[cfg(feature = "services-etcd")]
    pub use opendal_service_etcd::*;
    #[cfg(feature = "services-foundationdb")]
    pub use opendal_service_foundationdb::*;
    #[cfg(feature = "services-foyer")]
    pub use opendal_service_foyer::*;
    #[cfg(feature = "services-fs")]
    pub use opendal_service_fs::*;
    #[cfg(feature = "services-ftp")]
    pub use opendal_service_ftp::*;
    #[cfg(feature = "services-gcs")]
    pub use opendal_service_gcs::*;
    #[cfg(feature = "services-gdrive")]
    pub use opendal_service_gdrive::*;
    #[cfg(feature = "services-ghac")]
    pub use opendal_service_ghac::*;
    #[cfg(feature = "services-github")]
    pub use opendal_service_github::*;
    #[cfg(feature = "services-gridfs")]
    pub use opendal_service_gridfs::*;
    #[cfg(feature = "services-hdfs")]
    pub use opendal_service_hdfs::*;
    #[cfg(feature = "services-hdfs-native")]
    pub use opendal_service_hdfs_native::*;
    #[cfg(feature = "services-hf")]
    pub use opendal_service_hf::*;
    #[cfg(feature = "services-http")]
    pub use opendal_service_http::*;
    #[cfg(feature = "services-ipfs")]
    pub use opendal_service_ipfs::*;
    #[cfg(feature = "services-ipmfs")]
    pub use opendal_service_ipmfs::*;
    #[cfg(feature = "services-koofr")]
    pub use opendal_service_koofr::*;
    #[cfg(feature = "services-lakefs")]
    pub use opendal_service_lakefs::*;
    #[cfg(feature = "services-memcached")]
    pub use opendal_service_memcached::*;
    #[cfg(feature = "services-mini-moka")]
    pub use opendal_service_mini_moka::*;
    #[cfg(feature = "services-moka")]
    pub use opendal_service_moka::*;
    #[cfg(feature = "services-mongodb")]
    pub use opendal_service_mongodb::*;
    #[cfg(feature = "services-monoiofs")]
    pub use opendal_service_monoiofs::*;
    #[cfg(feature = "services-mysql")]
    pub use opendal_service_mysql::*;
    #[cfg(feature = "services-obs")]
    pub use opendal_service_obs::*;
    #[cfg(feature = "services-onedrive")]
    pub use opendal_service_onedrive::*;
    #[cfg(all(target_arch = "wasm32", feature = "services-opfs"))]
    pub use opendal_service_opfs::*;
    #[cfg(feature = "services-oss")]
    pub use opendal_service_oss::*;
    #[cfg(feature = "services-pcloud")]
    pub use opendal_service_pcloud::*;
    #[cfg(feature = "services-persy")]
    pub use opendal_service_persy::*;
    #[cfg(feature = "services-postgresql")]
    pub use opendal_service_postgresql::*;
    #[cfg(feature = "services-redb")]
    pub use opendal_service_redb::*;
    #[cfg(feature = "services-redis")]
    pub use opendal_service_redis::*;
    #[cfg(feature = "services-rocksdb")]
    pub use opendal_service_rocksdb::*;
    #[cfg(feature = "services-s3")]
    pub use opendal_service_s3::*;
    #[cfg(feature = "services-seafile")]
    pub use opendal_service_seafile::*;
    #[cfg(feature = "services-sftp")]
    pub use opendal_service_sftp::*;
    #[cfg(feature = "services-sled")]
    pub use opendal_service_sled::*;
    #[cfg(feature = "services-sqlite")]
    pub use opendal_service_sqlite::*;
    #[cfg(feature = "services-surrealdb")]
    pub use opendal_service_surrealdb::*;
    #[cfg(feature = "services-swift")]
    pub use opendal_service_swift::*;
    #[cfg(feature = "services-tikv")]
    pub use opendal_service_tikv::*;
    #[cfg(feature = "services-upyun")]
    pub use opendal_service_upyun::*;
    #[cfg(feature = "services-vercel-artifacts")]
    pub use opendal_service_vercel_artifacts::*;
    #[cfg(feature = "services-vercel-blob")]
    pub use opendal_service_vercel_blob::*;
    #[cfg(feature = "services-webdav")]
    pub use opendal_service_webdav::*;
    #[cfg(feature = "services-webhdfs")]
    pub use opendal_service_webhdfs::*;
    #[cfg(feature = "services-yandex-disk")]
    pub use opendal_service_yandex_disk::*;
}

/// Re-export of layers.
pub mod layers {
    pub use opendal_core::layers::*;
    #[cfg(feature = "layers-async-backtrace")]
    pub use opendal_layer_async_backtrace::*;
    #[cfg(feature = "layers-await-tree")]
    pub use opendal_layer_await_tree::*;
    #[cfg(feature = "layers-capability-check")]
    pub use opendal_layer_capability_check::*;
    #[cfg(feature = "layers-chaos")]
    pub use opendal_layer_chaos::*;
    #[cfg(feature = "layers-concurrent-limit")]
    pub use opendal_layer_concurrent_limit::*;
    #[cfg(all(target_os = "linux", feature = "layers-dtrace"))]
    pub use opendal_layer_dtrace::*;
    #[cfg(feature = "layers-fastmetrics")]
    pub use opendal_layer_fastmetrics::*;
    #[cfg(feature = "layers-fastrace")]
    pub use opendal_layer_fastrace::*;
    #[cfg(feature = "layers-foyer")]
    pub use opendal_layer_foyer::*;
    #[cfg(feature = "layers-hotpath")]
    pub use opendal_layer_hotpath::*;
    #[cfg(feature = "layers-immutable-index")]
    pub use opendal_layer_immutable_index::*;
    #[cfg(feature = "layers-logging")]
    pub use opendal_layer_logging::*;
    #[cfg(feature = "layers-metrics")]
    pub use opendal_layer_metrics::*;
    #[cfg(feature = "layers-mime-guess")]
    pub use opendal_layer_mime_guess::*;
    #[cfg(feature = "layers-otel-metrics")]
    pub use opendal_layer_otelmetrics::*;
    #[cfg(feature = "layers-otel-trace")]
    pub use opendal_layer_oteltrace::*;
    #[cfg(feature = "layers-prometheus")]
    pub use opendal_layer_prometheus::*;
    #[cfg(feature = "layers-prometheus-client")]
    pub use opendal_layer_prometheus_client::*;
    #[cfg(feature = "layers-retry")]
    pub use opendal_layer_retry::*;
    #[cfg(feature = "layers-route")]
    pub use opendal_layer_route::*;
    #[cfg(feature = "layers-tail-cut")]
    pub use opendal_layer_tail_cut::*;
    #[cfg(feature = "layers-throttle")]
    pub use opendal_layer_throttle::*;
    #[cfg(feature = "layers-timeout")]
    pub use opendal_layer_timeout::*;
    #[cfg(feature = "layers-tracing")]
    pub use opendal_layer_tracing::*;
}