opendal 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Cargo.lock +3448 -0
- data/Cargo.toml +1 -1
- data/DEPENDENCIES.rust.tsv +31 -31
- data/README.md +4 -1
- data/Rakefile +0 -7
- data/core/CHANGELOG.md +80 -0
- data/core/Cargo.lock +495 -599
- data/core/Cargo.toml +98 -95
- data/core/DEPENDENCIES.rust.tsv +319 -324
- data/core/NOTICE +5 -0
- data/core/README.md +11 -6
- data/core/benches/vs_fs/Cargo.toml +1 -1
- data/core/benches/vs_s3/Cargo.toml +1 -1
- data/core/core/Cargo.toml +2 -2
- data/core/core/LICENSE +201 -0
- data/core/core/NOTICE +5 -0
- data/core/core/README.md +93 -0
- data/core/core/src/blocking/delete.rs +2 -2
- data/core/core/src/blocking/list.rs +2 -1
- data/core/core/src/blocking/operator.rs +10 -5
- data/core/core/src/blocking/read/std_bytes_iterator.rs +2 -1
- data/core/core/src/blocking/read/std_reader.rs +2 -1
- data/core/core/src/blocking/write/std_writer.rs +1 -1
- data/core/core/src/docs/performance/http_optimization.md +9 -1
- data/core/core/src/docs/rfcs/7749_http_transporter.md +9 -5
- data/core/core/src/layers/mod.rs +6 -1
- data/core/core/src/lib.rs +2 -137
- data/core/core/src/raw/accessor.rs +23 -21
- data/core/core/src/raw/oio/buf/queue_buf.rs +4 -2
- data/core/core/src/raw/oio/write/block_write.rs +3 -2
- data/core/core/src/raw/operation.rs +5 -5
- data/core/core/src/raw/ops.rs +85 -63
- data/core/core/src/raw/std_io_util.rs +33 -1
- data/core/core/src/services/memory/backend.rs +0 -1
- data/core/core/src/services/memory/mod.rs +6 -2
- data/core/core/src/services/mod.rs +8 -2
- data/core/core/src/types/buffer.rs +4 -4
- data/core/core/src/types/builder.rs +15 -17
- data/core/core/src/types/copy.rs +3 -3
- data/core/core/src/types/entry.rs +3 -1
- data/core/core/src/types/error.rs +16 -11
- data/core/core/src/types/execute/executors/mod.rs +3 -3
- data/core/core/src/types/http_transport/mod.rs +6 -0
- data/core/core/src/types/list.rs +5 -6
- data/core/core/src/types/operator/info.rs +6 -4
- data/core/core/src/types/operator/mod.rs +1 -1
- data/core/core/src/types/operator/operator.rs +42 -8
- data/core/core/src/types/operator/operator_futures.rs +36 -38
- data/core/core/src/types/operator/registry.rs +73 -14
- data/core/core/src/types/options.rs +48 -42
- data/core/core/src/types/read/reader.rs +2 -1
- data/core/core/src/types/write/writer.rs +2 -1
- data/core/http-transports/reqwest/Cargo.toml +2 -1
- data/core/http-transports/reqwest/LICENSE +201 -0
- data/core/http-transports/reqwest/NOTICE +5 -0
- data/core/http-transports/reqwest/README.md +37 -9
- data/core/http-transports/reqwest/src/lib.rs +30 -51
- data/core/layers/async-backtrace/Cargo.toml +3 -2
- data/core/layers/async-backtrace/LICENSE +201 -0
- data/core/layers/async-backtrace/NOTICE +5 -0
- data/core/layers/async-backtrace/README.md +48 -0
- data/core/layers/async-backtrace/src/lib.rs +5 -5
- data/core/layers/await-tree/Cargo.toml +3 -2
- data/core/layers/await-tree/LICENSE +201 -0
- data/core/layers/await-tree/NOTICE +5 -0
- data/core/layers/await-tree/README.md +48 -0
- data/core/layers/await-tree/src/lib.rs +5 -6
- data/core/layers/capability-check/Cargo.toml +3 -2
- data/core/layers/capability-check/LICENSE +201 -0
- data/core/layers/capability-check/NOTICE +5 -0
- data/core/layers/capability-check/README.md +48 -0
- data/core/layers/capability-check/src/lib.rs +7 -8
- data/core/layers/chaos/Cargo.toml +3 -2
- data/core/layers/chaos/LICENSE +201 -0
- data/core/layers/chaos/NOTICE +5 -0
- data/core/layers/chaos/README.md +47 -0
- data/core/layers/chaos/src/lib.rs +6 -7
- data/core/layers/concurrent-limit/Cargo.toml +3 -2
- data/core/layers/concurrent-limit/LICENSE +201 -0
- data/core/layers/concurrent-limit/NOTICE +5 -0
- data/core/layers/concurrent-limit/README.md +48 -0
- data/core/layers/concurrent-limit/src/lib.rs +8 -14
- data/core/layers/dtrace/Cargo.toml +3 -2
- data/core/layers/dtrace/LICENSE +201 -0
- data/core/layers/dtrace/NOTICE +5 -0
- data/core/layers/dtrace/README.md +52 -0
- data/core/layers/dtrace/src/lib.rs +5 -5
- data/core/layers/fastmetrics/Cargo.toml +4 -3
- data/core/layers/fastmetrics/LICENSE +201 -0
- data/core/layers/fastmetrics/NOTICE +5 -0
- data/core/layers/fastmetrics/README.md +47 -0
- data/core/layers/fastmetrics/src/lib.rs +4 -4
- data/core/layers/fastrace/Cargo.toml +3 -2
- data/core/layers/fastrace/LICENSE +201 -0
- data/core/layers/fastrace/NOTICE +5 -0
- data/core/layers/fastrace/README.md +47 -0
- data/core/layers/fastrace/src/lib.rs +5 -5
- data/core/layers/foyer/Cargo.toml +3 -2
- data/core/layers/foyer/LICENSE +201 -0
- data/core/layers/foyer/NOTICE +5 -0
- data/core/layers/foyer/README.md +47 -0
- data/core/layers/foyer/src/deleter.rs +1 -0
- data/core/layers/foyer/src/lib.rs +27 -10
- data/core/layers/foyer/src/writer.rs +1 -0
- data/core/layers/hotpath/Cargo.toml +4 -3
- data/core/layers/hotpath/LICENSE +201 -0
- data/core/layers/hotpath/NOTICE +5 -0
- data/core/layers/hotpath/README.md +47 -0
- data/core/layers/hotpath/src/lib.rs +4 -4
- data/core/layers/immutable-index/Cargo.toml +3 -2
- data/core/layers/immutable-index/LICENSE +201 -0
- data/core/layers/immutable-index/NOTICE +5 -0
- data/core/layers/immutable-index/README.md +48 -0
- data/core/layers/immutable-index/src/lib.rs +3 -4
- data/core/layers/logging/Cargo.toml +3 -2
- data/core/layers/logging/LICENSE +201 -0
- data/core/layers/logging/NOTICE +5 -0
- data/core/layers/logging/README.md +47 -0
- data/core/layers/logging/src/lib.rs +11 -11
- data/core/layers/metrics/Cargo.toml +4 -3
- data/core/layers/metrics/LICENSE +201 -0
- data/core/layers/metrics/NOTICE +5 -0
- data/core/layers/metrics/README.md +47 -0
- data/core/layers/metrics/src/lib.rs +6 -6
- data/core/layers/mime-guess/Cargo.toml +3 -2
- data/core/layers/mime-guess/LICENSE +201 -0
- data/core/layers/mime-guess/NOTICE +5 -0
- data/core/layers/mime-guess/README.md +47 -0
- data/core/layers/mime-guess/src/lib.rs +13 -17
- data/core/layers/observe-metrics-common/Cargo.toml +2 -1
- data/core/layers/observe-metrics-common/LICENSE +201 -0
- data/core/layers/observe-metrics-common/NOTICE +5 -0
- data/core/layers/observe-metrics-common/README.md +27 -0
- data/core/layers/observe-metrics-common/src/lib.rs +15 -9
- data/core/layers/otelmetrics/Cargo.toml +4 -3
- data/core/layers/otelmetrics/LICENSE +201 -0
- data/core/layers/otelmetrics/NOTICE +5 -0
- data/core/layers/otelmetrics/README.md +47 -0
- data/core/layers/otelmetrics/src/lib.rs +4 -4
- data/core/layers/oteltrace/Cargo.toml +3 -2
- data/core/layers/oteltrace/LICENSE +201 -0
- data/core/layers/oteltrace/NOTICE +5 -0
- data/core/layers/oteltrace/README.md +48 -0
- data/core/layers/oteltrace/src/lib.rs +13 -4
- data/core/layers/prometheus/Cargo.toml +4 -3
- data/core/layers/prometheus/LICENSE +201 -0
- data/core/layers/prometheus/NOTICE +5 -0
- data/core/layers/prometheus/README.md +47 -0
- data/core/layers/prometheus/src/lib.rs +4 -4
- data/core/layers/prometheus-client/Cargo.toml +4 -3
- data/core/layers/prometheus-client/LICENSE +201 -0
- data/core/layers/prometheus-client/NOTICE +5 -0
- data/core/layers/prometheus-client/README.md +48 -0
- data/core/layers/prometheus-client/src/lib.rs +4 -4
- data/core/layers/retry/Cargo.toml +5 -4
- data/core/layers/retry/LICENSE +201 -0
- data/core/layers/retry/NOTICE +5 -0
- data/core/layers/retry/README.md +50 -0
- data/core/layers/retry/src/lib.rs +6 -7
- data/core/layers/route/Cargo.toml +4 -3
- data/core/layers/route/LICENSE +201 -0
- data/core/layers/route/NOTICE +5 -0
- data/core/layers/route/README.md +58 -0
- data/core/layers/route/src/lib.rs +39 -9
- data/core/layers/tail-cut/Cargo.toml +3 -2
- data/core/layers/tail-cut/LICENSE +201 -0
- data/core/layers/tail-cut/NOTICE +5 -0
- data/core/layers/tail-cut/README.md +47 -0
- data/core/layers/tail-cut/src/lib.rs +7 -9
- data/core/layers/throttle/Cargo.toml +3 -2
- data/core/layers/throttle/LICENSE +201 -0
- data/core/layers/throttle/NOTICE +5 -0
- data/core/layers/throttle/README.md +47 -0
- data/core/layers/throttle/src/lib.rs +5 -7
- data/core/layers/timeout/Cargo.toml +4 -3
- data/core/layers/timeout/LICENSE +201 -0
- data/core/layers/timeout/NOTICE +5 -0
- data/core/layers/timeout/README.md +50 -0
- data/core/layers/timeout/src/lib.rs +9 -10
- data/core/layers/tracing/Cargo.toml +3 -2
- data/core/layers/tracing/LICENSE +201 -0
- data/core/layers/tracing/NOTICE +5 -0
- data/core/layers/tracing/README.md +47 -0
- data/core/layers/tracing/src/lib.rs +4 -4
- data/core/services/aliyun-drive/Cargo.toml +2 -1
- data/core/services/aliyun-drive/LICENSE +201 -0
- data/core/services/aliyun-drive/NOTICE +5 -0
- data/core/services/aliyun-drive/README.md +56 -0
- data/core/services/aliyun-drive/src/backend.rs +2 -2
- data/core/services/aliyun-drive/src/docs.md +7 -9
- data/core/services/aliyun-drive/src/lib.rs +12 -2
- data/core/services/aliyun-drive/src/lister.rs +2 -2
- data/core/services/alluxio/Cargo.toml +2 -1
- data/core/services/alluxio/LICENSE +201 -0
- data/core/services/alluxio/NOTICE +5 -0
- data/core/services/alluxio/README.md +56 -0
- data/core/services/alluxio/src/backend.rs +3 -3
- data/core/services/alluxio/src/docs.md +7 -5
- data/core/services/alluxio/src/lib.rs +12 -2
- data/core/services/azblob/Cargo.toml +6 -5
- data/core/services/azblob/LICENSE +201 -0
- data/core/services/azblob/NOTICE +5 -0
- data/core/services/azblob/README.md +56 -0
- data/core/services/azblob/src/backend.rs +3 -3
- data/core/services/azblob/src/core.rs +3 -3
- data/core/services/azblob/src/docs.md +7 -9
- data/core/services/azblob/src/lib.rs +14 -2
- data/core/services/azdls/Cargo.toml +6 -5
- data/core/services/azdls/LICENSE +201 -0
- data/core/services/azdls/NOTICE +5 -0
- data/core/services/azdls/README.md +56 -0
- data/core/services/azdls/src/backend.rs +3 -3
- data/core/services/azdls/src/docs.md +7 -8
- data/core/services/azdls/src/lib.rs +12 -2
- data/core/services/azdls/src/lister.rs +1 -1
- data/core/services/azfile/Cargo.toml +6 -5
- data/core/services/azfile/LICENSE +201 -0
- data/core/services/azfile/NOTICE +5 -0
- data/core/services/azfile/README.md +56 -0
- data/core/services/azfile/src/backend.rs +2 -2
- data/core/services/azfile/src/docs.md +7 -8
- data/core/services/azfile/src/lib.rs +12 -2
- data/core/services/azure-common/Cargo.toml +2 -1
- data/core/services/azure-common/LICENSE +201 -0
- data/core/services/azure-common/NOTICE +5 -0
- data/core/services/azure-common/README.md +26 -0
- data/core/services/azure-common/src/lib.rs +2 -5
- data/core/services/b2/Cargo.toml +2 -1
- data/core/services/b2/LICENSE +201 -0
- data/core/services/b2/NOTICE +5 -0
- data/core/services/b2/README.md +56 -0
- data/core/services/b2/src/backend.rs +4 -4
- data/core/services/b2/src/docs.md +7 -8
- data/core/services/b2/src/lib.rs +9 -3
- data/core/services/cacache/Cargo.toml +2 -1
- data/core/services/cacache/LICENSE +201 -0
- data/core/services/cacache/NOTICE +5 -0
- data/core/services/cacache/README.md +56 -0
- data/core/services/cacache/src/backend.rs +0 -1
- data/core/services/cacache/src/docs.md +7 -4
- data/core/services/cacache/src/lib.rs +9 -4
- data/core/services/cloudflare-kv/Cargo.toml +2 -1
- data/core/services/cloudflare-kv/LICENSE +201 -0
- data/core/services/cloudflare-kv/NOTICE +5 -0
- data/core/services/cloudflare-kv/README.md +56 -0
- data/core/services/cloudflare-kv/src/backend.rs +0 -2
- data/core/services/cloudflare-kv/src/docs.md +7 -5
- data/core/services/cloudflare-kv/src/lib.rs +9 -3
- data/core/services/compfs/Cargo.toml +2 -1
- data/core/services/compfs/LICENSE +201 -0
- data/core/services/compfs/NOTICE +5 -0
- data/core/services/compfs/README.md +58 -0
- data/core/services/compfs/src/lib.rs +9 -3
- data/core/services/cos/Cargo.toml +5 -4
- data/core/services/cos/LICENSE +201 -0
- data/core/services/cos/NOTICE +5 -0
- data/core/services/cos/README.md +56 -0
- data/core/services/cos/src/backend.rs +4 -4
- data/core/services/cos/src/docs.md +7 -9
- data/core/services/cos/src/lib.rs +12 -2
- data/core/services/d1/Cargo.toml +2 -1
- data/core/services/d1/LICENSE +201 -0
- data/core/services/d1/NOTICE +5 -0
- data/core/services/d1/README.md +56 -0
- data/core/services/d1/src/docs.md +7 -8
- data/core/services/d1/src/lib.rs +9 -3
- data/core/services/dashmap/Cargo.toml +2 -1
- data/core/services/dashmap/LICENSE +201 -0
- data/core/services/dashmap/NOTICE +5 -0
- data/core/services/dashmap/README.md +56 -0
- data/core/services/dashmap/src/backend.rs +1 -2
- data/core/services/dashmap/src/docs.md +7 -4
- data/core/services/dashmap/src/lib.rs +9 -4
- data/core/services/dbfs/Cargo.toml +2 -1
- data/core/services/dbfs/LICENSE +201 -0
- data/core/services/dbfs/NOTICE +5 -0
- data/core/services/dbfs/README.md +56 -0
- data/core/services/dbfs/src/backend.rs +2 -2
- data/core/services/dbfs/src/core.rs +1 -1
- data/core/services/dbfs/src/docs.md +7 -6
- data/core/services/dbfs/src/lib.rs +9 -4
- data/core/services/dbfs/src/lister.rs +1 -1
- data/core/services/dropbox/Cargo.toml +2 -1
- data/core/services/dropbox/LICENSE +201 -0
- data/core/services/dropbox/NOTICE +5 -0
- data/core/services/dropbox/README.md +56 -0
- data/core/services/dropbox/src/docs.md +7 -4
- data/core/services/dropbox/src/lib.rs +9 -4
- data/core/services/etcd/Cargo.toml +2 -1
- data/core/services/etcd/LICENSE +201 -0
- data/core/services/etcd/NOTICE +5 -0
- data/core/services/etcd/README.md +56 -0
- data/core/services/etcd/src/docs.md +7 -10
- data/core/services/etcd/src/lib.rs +9 -4
- data/core/services/foundationdb/Cargo.toml +2 -1
- data/core/services/foundationdb/LICENSE +201 -0
- data/core/services/foundationdb/NOTICE +5 -0
- data/core/services/foundationdb/README.md +56 -0
- data/core/services/foundationdb/src/docs.md +7 -5
- data/core/services/foundationdb/src/lib.rs +9 -4
- data/core/services/foyer/Cargo.toml +4 -3
- data/core/services/foyer/LICENSE +201 -0
- data/core/services/foyer/NOTICE +5 -0
- data/core/services/foyer/README.md +57 -0
- data/core/services/foyer/src/backend.rs +1 -1
- data/core/services/foyer/src/docs.md +12 -1
- data/core/services/foyer/src/lib.rs +9 -11
- data/core/services/fs/Cargo.toml +2 -1
- data/core/services/fs/LICENSE +201 -0
- data/core/services/fs/NOTICE +5 -0
- data/core/services/fs/README.md +56 -0
- data/core/services/fs/src/backend.rs +1 -1
- data/core/services/fs/src/docs.md +7 -5
- data/core/services/fs/src/lib.rs +9 -3
- data/core/services/ftp/Cargo.toml +2 -1
- data/core/services/ftp/LICENSE +201 -0
- data/core/services/ftp/NOTICE +5 -0
- data/core/services/ftp/README.md +56 -0
- data/core/services/ftp/src/backend.rs +1 -1
- data/core/services/ftp/src/docs.md +7 -7
- data/core/services/ftp/src/lib.rs +12 -2
- data/core/services/ftp/src/lister.rs +1 -1
- data/core/services/gcs/Cargo.toml +5 -4
- data/core/services/gcs/LICENSE +201 -0
- data/core/services/gcs/NOTICE +5 -0
- data/core/services/gcs/README.md +56 -0
- data/core/services/gcs/src/core.rs +55 -1
- data/core/services/gcs/src/docs.md +7 -13
- data/core/services/gcs/src/lib.rs +9 -3
- data/core/services/gcs/src/writer.rs +5 -12
- data/core/services/gdrive/Cargo.toml +2 -1
- data/core/services/gdrive/LICENSE +201 -0
- data/core/services/gdrive/NOTICE +5 -0
- data/core/services/gdrive/README.md +56 -0
- data/core/services/gdrive/src/docs.md +8 -5
- data/core/services/gdrive/src/lib.rs +12 -2
- data/core/services/gdrive/src/lister.rs +6 -6
- data/core/services/ghac/Cargo.toml +5 -4
- data/core/services/ghac/LICENSE +201 -0
- data/core/services/ghac/NOTICE +5 -0
- data/core/services/ghac/README.md +56 -0
- data/core/services/ghac/src/docs.md +7 -4
- data/core/services/ghac/src/lib.rs +12 -2
- data/core/services/github/Cargo.toml +2 -1
- data/core/services/github/LICENSE +201 -0
- data/core/services/github/NOTICE +5 -0
- data/core/services/github/README.md +56 -0
- data/core/services/github/src/backend.rs +4 -4
- data/core/services/github/src/docs.md +7 -8
- data/core/services/github/src/lib.rs +12 -2
- data/core/services/goosefs/Cargo.toml +4 -3
- data/core/services/goosefs/LICENSE +201 -0
- data/core/services/goosefs/NOTICE +5 -0
- data/core/services/goosefs/README.md +56 -0
- data/core/services/goosefs/src/backend.rs +31 -12
- data/core/services/goosefs/src/config.rs +1 -1
- data/core/services/goosefs/src/core.rs +72 -25
- data/core/services/goosefs/src/docs.md +10 -10
- data/core/services/goosefs/src/lib.rs +12 -2
- data/core/services/goosefs/src/writer.rs +24 -20
- data/core/services/goosefs/tests/safe_conditional_put.rs +199 -0
- data/core/services/gridfs/Cargo.toml +2 -1
- data/core/services/gridfs/LICENSE +201 -0
- data/core/services/gridfs/NOTICE +5 -0
- data/core/services/gridfs/README.md +56 -0
- data/core/services/gridfs/src/docs.md +7 -6
- data/core/services/gridfs/src/lib.rs +9 -4
- data/core/services/hdfs/Cargo.toml +2 -1
- data/core/services/hdfs/LICENSE +201 -0
- data/core/services/hdfs/NOTICE +5 -0
- data/core/services/hdfs/README.md +58 -0
- data/core/services/hdfs/src/backend.rs +1 -1
- data/core/services/hdfs/src/docs.md +9 -9
- data/core/services/hdfs/src/lib.rs +12 -2
- data/core/services/hdfs-native/Cargo.toml +3 -2
- data/core/services/hdfs-native/LICENSE +201 -0
- data/core/services/hdfs-native/NOTICE +5 -0
- data/core/services/hdfs-native/README.md +56 -0
- data/core/services/hdfs-native/src/backend.rs +3 -2
- data/core/services/hdfs-native/src/docs.md +7 -4
- data/core/services/hdfs-native/src/lib.rs +12 -2
- data/core/services/hdfs-native/src/writer.rs +1 -1
- data/core/services/hf/Cargo.toml +3 -2
- data/core/services/hf/LICENSE +201 -0
- data/core/services/hf/NOTICE +5 -0
- data/core/services/hf/README.md +56 -0
- data/core/services/hf/src/backend.rs +11 -9
- data/core/services/hf/src/config.rs +1 -1
- data/core/services/hf/src/core.rs +12 -12
- data/core/services/hf/src/docs.md +11 -12
- data/core/services/hf/src/lib.rs +13 -3
- data/core/services/hf/src/lister.rs +1 -1
- data/core/services/http/Cargo.toml +4 -3
- data/core/services/http/LICENSE +201 -0
- data/core/services/http/NOTICE +5 -0
- data/core/services/http/README.md +56 -0
- data/core/services/http/src/backend.rs +1 -1
- data/core/services/http/src/docs.md +7 -5
- data/core/services/http/src/lib.rs +10 -4
- data/core/services/ipfs/Cargo.toml +2 -1
- data/core/services/ipfs/LICENSE +201 -0
- data/core/services/ipfs/NOTICE +5 -0
- data/core/services/ipfs/README.md +56 -0
- data/core/services/ipfs/src/backend.rs +2 -2
- data/core/services/ipfs/src/docs.md +7 -5
- data/core/services/ipfs/src/lib.rs +9 -3
- data/core/services/ipmfs/Cargo.toml +2 -1
- data/core/services/ipmfs/LICENSE +201 -0
- data/core/services/ipmfs/NOTICE +5 -0
- data/core/services/ipmfs/README.md +56 -0
- data/core/services/ipmfs/src/docs.md +10 -1
- data/core/services/ipmfs/src/lib.rs +12 -2
- data/core/services/ipmfs/src/lister.rs +2 -2
- data/core/services/koofr/Cargo.toml +2 -1
- data/core/services/koofr/LICENSE +201 -0
- data/core/services/koofr/NOTICE +5 -0
- data/core/services/koofr/README.md +56 -0
- data/core/services/koofr/src/backend.rs +4 -4
- data/core/services/koofr/src/docs.md +7 -7
- data/core/services/koofr/src/lib.rs +12 -2
- data/core/services/lakefs/Cargo.toml +2 -1
- data/core/services/lakefs/LICENSE +201 -0
- data/core/services/lakefs/NOTICE +5 -0
- data/core/services/lakefs/README.md +56 -0
- data/core/services/lakefs/src/backend.rs +5 -5
- data/core/services/lakefs/src/docs.md +7 -9
- data/core/services/lakefs/src/lib.rs +9 -4
- data/core/services/lakefs/src/lister.rs +1 -1
- data/core/services/memcached/Cargo.toml +3 -2
- data/core/services/memcached/LICENSE +201 -0
- data/core/services/memcached/NOTICE +5 -0
- data/core/services/memcached/README.md +56 -0
- data/core/services/memcached/src/docs.md +7 -8
- data/core/services/memcached/src/lib.rs +9 -4
- data/core/services/mini_moka/Cargo.toml +2 -1
- data/core/services/mini_moka/LICENSE +201 -0
- data/core/services/mini_moka/NOTICE +5 -0
- data/core/services/mini_moka/README.md +56 -0
- data/core/services/mini_moka/src/backend.rs +1 -1
- data/core/services/mini_moka/src/docs.md +10 -1
- data/core/services/mini_moka/src/lib.rs +9 -4
- data/core/services/moka/Cargo.toml +2 -1
- data/core/services/moka/LICENSE +201 -0
- data/core/services/moka/NOTICE +5 -0
- data/core/services/moka/README.md +56 -0
- data/core/services/moka/src/backend.rs +1 -2
- data/core/services/moka/src/docs.md +7 -7
- data/core/services/moka/src/lib.rs +9 -3
- data/core/services/mongodb/Cargo.toml +2 -1
- data/core/services/mongodb/LICENSE +201 -0
- data/core/services/mongodb/NOTICE +5 -0
- data/core/services/mongodb/README.md +56 -0
- data/core/services/mongodb/src/docs.md +7 -7
- data/core/services/mongodb/src/lib.rs +12 -2
- data/core/services/monoiofs/Cargo.toml +2 -1
- data/core/services/monoiofs/LICENSE +201 -0
- data/core/services/monoiofs/NOTICE +5 -0
- data/core/services/monoiofs/README.md +58 -0
- data/core/services/monoiofs/src/docs.md +7 -4
- data/core/services/monoiofs/src/lib.rs +9 -4
- data/core/services/mysql/Cargo.toml +2 -1
- data/core/services/mysql/LICENSE +201 -0
- data/core/services/mysql/NOTICE +5 -0
- data/core/services/mysql/README.md +56 -0
- data/core/services/mysql/src/docs.md +7 -6
- data/core/services/mysql/src/lib.rs +12 -2
- data/core/services/obs/Cargo.toml +5 -4
- data/core/services/obs/LICENSE +201 -0
- data/core/services/obs/NOTICE +5 -0
- data/core/services/obs/README.md +56 -0
- data/core/services/obs/src/backend.rs +4 -4
- data/core/services/obs/src/docs.md +7 -9
- data/core/services/obs/src/lib.rs +12 -2
- data/core/services/onedrive/Cargo.toml +2 -1
- data/core/services/onedrive/LICENSE +201 -0
- data/core/services/onedrive/NOTICE +5 -0
- data/core/services/onedrive/README.md +56 -0
- data/core/services/onedrive/src/docs.md +10 -10
- data/core/services/onedrive/src/lib.rs +9 -3
- data/core/services/opfs/Cargo.toml +4 -1
- data/core/services/opfs/LICENSE +201 -0
- data/core/services/opfs/NOTICE +5 -0
- data/core/services/opfs/README.md +63 -0
- data/core/services/opfs/src/core.rs +2 -0
- data/core/services/opfs/src/docs.md +7 -1
- data/core/services/opfs/src/lib.rs +11 -2
- data/core/services/oss/Cargo.toml +5 -4
- data/core/services/oss/LICENSE +201 -0
- data/core/services/oss/NOTICE +5 -0
- data/core/services/oss/README.md +56 -0
- data/core/services/oss/src/backend.rs +4 -4
- data/core/services/oss/src/docs.md +10 -22
- data/core/services/oss/src/lib.rs +9 -3
- data/core/services/pcloud/Cargo.toml +2 -1
- data/core/services/pcloud/LICENSE +201 -0
- data/core/services/pcloud/NOTICE +5 -0
- data/core/services/pcloud/README.md +56 -0
- data/core/services/pcloud/src/backend.rs +3 -3
- data/core/services/pcloud/src/docs.md +7 -7
- data/core/services/pcloud/src/lib.rs +9 -3
- data/core/services/persy/Cargo.toml +2 -1
- data/core/services/persy/LICENSE +201 -0
- data/core/services/persy/NOTICE +5 -0
- data/core/services/persy/README.md +56 -0
- data/core/services/persy/src/backend.rs +0 -1
- data/core/services/persy/src/docs.md +7 -6
- data/core/services/persy/src/lib.rs +9 -3
- data/core/services/postgresql/Cargo.toml +2 -1
- data/core/services/postgresql/LICENSE +201 -0
- data/core/services/postgresql/NOTICE +5 -0
- data/core/services/postgresql/README.md +56 -0
- data/core/services/postgresql/src/docs.md +7 -6
- data/core/services/postgresql/src/lib.rs +12 -2
- data/core/services/redb/Cargo.toml +2 -1
- data/core/services/redb/LICENSE +201 -0
- data/core/services/redb/NOTICE +5 -0
- data/core/services/redb/README.md +56 -0
- data/core/services/redb/src/backend.rs +0 -1
- data/core/services/redb/src/docs.md +7 -5
- data/core/services/redb/src/lib.rs +9 -3
- data/core/services/redis/Cargo.toml +2 -1
- data/core/services/redis/LICENSE +201 -0
- data/core/services/redis/NOTICE +5 -0
- data/core/services/redis/README.md +56 -0
- data/core/services/redis/src/docs.md +7 -9
- data/core/services/redis/src/lib.rs +9 -4
- data/core/services/rocksdb/Cargo.toml +2 -1
- data/core/services/rocksdb/LICENSE +201 -0
- data/core/services/rocksdb/NOTICE +5 -0
- data/core/services/rocksdb/README.md +56 -0
- data/core/services/rocksdb/src/backend.rs +0 -1
- data/core/services/rocksdb/src/docs.md +7 -5
- data/core/services/rocksdb/src/lib.rs +12 -2
- data/core/services/s3/Cargo.toml +5 -4
- data/core/services/s3/LICENSE +201 -0
- data/core/services/s3/NOTICE +5 -0
- data/core/services/s3/README.md +56 -0
- data/core/services/s3/src/backend.rs +60 -7
- data/core/services/s3/src/compatible_services.md +10 -2
- data/core/services/s3/src/core.rs +16 -8
- data/core/services/s3/src/docs.md +7 -28
- data/core/services/s3/src/lib.rs +9 -3
- data/core/services/seafile/Cargo.toml +2 -1
- data/core/services/seafile/LICENSE +201 -0
- data/core/services/seafile/NOTICE +5 -0
- data/core/services/seafile/README.md +56 -0
- data/core/services/seafile/src/backend.rs +3 -3
- data/core/services/seafile/src/docs.md +7 -8
- data/core/services/seafile/src/lib.rs +12 -2
- data/core/services/sftp/Cargo.toml +2 -1
- data/core/services/sftp/LICENSE +201 -0
- data/core/services/sftp/NOTICE +5 -0
- data/core/services/sftp/README.md +56 -0
- data/core/services/sftp/src/backend.rs +2 -2
- data/core/services/sftp/src/docs.md +7 -9
- data/core/services/sftp/src/lib.rs +9 -4
- data/core/services/sled/Cargo.toml +2 -1
- data/core/services/sled/LICENSE +201 -0
- data/core/services/sled/NOTICE +5 -0
- data/core/services/sled/README.md +56 -0
- data/core/services/sled/src/backend.rs +0 -1
- data/core/services/sled/src/docs.md +7 -4
- data/core/services/sled/src/lib.rs +12 -2
- data/core/services/sqlite/Cargo.toml +2 -1
- data/core/services/sqlite/LICENSE +201 -0
- data/core/services/sqlite/NOTICE +5 -0
- data/core/services/sqlite/README.md +56 -0
- data/core/services/sqlite/src/backend.rs +0 -1
- data/core/services/sqlite/src/docs.md +7 -6
- data/core/services/sqlite/src/lib.rs +12 -2
- data/core/services/surrealdb/Cargo.toml +2 -1
- data/core/services/surrealdb/LICENSE +201 -0
- data/core/services/surrealdb/NOTICE +5 -0
- data/core/services/surrealdb/README.md +56 -0
- data/core/services/surrealdb/src/docs.md +8 -10
- data/core/services/surrealdb/src/lib.rs +9 -3
- data/core/services/swift/Cargo.toml +2 -1
- data/core/services/swift/LICENSE +201 -0
- data/core/services/swift/NOTICE +5 -0
- data/core/services/swift/README.md +56 -0
- data/core/services/swift/src/backend.rs +2 -2
- data/core/services/swift/src/core.rs +24 -24
- data/core/services/swift/src/deleter.rs +1 -1
- data/core/services/swift/src/docs.md +7 -6
- data/core/services/swift/src/lib.rs +9 -4
- data/core/services/swift/src/writer.rs +1 -1
- data/core/services/tikv/Cargo.toml +2 -1
- data/core/services/tikv/LICENSE +201 -0
- data/core/services/tikv/NOTICE +5 -0
- data/core/services/tikv/README.md +56 -0
- data/core/services/tikv/src/backend.rs +1 -1
- data/core/services/tikv/src/docs.md +7 -8
- data/core/services/tikv/src/lib.rs +12 -2
- data/core/services/tos/Cargo.toml +5 -4
- data/core/services/tos/LICENSE +201 -0
- data/core/services/tos/NOTICE +5 -0
- data/core/services/tos/README.md +56 -0
- data/core/services/tos/src/docs.md +7 -10
- data/core/services/tos/src/lib.rs +9 -3
- data/core/services/upyun/Cargo.toml +2 -1
- data/core/services/upyun/LICENSE +201 -0
- data/core/services/upyun/NOTICE +5 -0
- data/core/services/upyun/README.md +56 -0
- data/core/services/upyun/src/backend.rs +3 -3
- data/core/services/upyun/src/docs.md +7 -7
- data/core/services/upyun/src/lib.rs +9 -4
- data/core/services/vercel-artifacts/Cargo.toml +2 -1
- data/core/services/vercel-artifacts/LICENSE +201 -0
- data/core/services/vercel-artifacts/NOTICE +5 -0
- data/core/services/vercel-artifacts/README.md +56 -0
- data/core/services/vercel-artifacts/src/docs.md +7 -7
- data/core/services/vercel-artifacts/src/lib.rs +11 -3
- data/core/services/vercel-blob/Cargo.toml +2 -1
- data/core/services/vercel-blob/LICENSE +201 -0
- data/core/services/vercel-blob/NOTICE +5 -0
- data/core/services/vercel-blob/README.md +56 -0
- data/core/services/vercel-blob/src/backend.rs +2 -2
- data/core/services/vercel-blob/src/docs.md +7 -5
- data/core/services/vercel-blob/src/lib.rs +12 -2
- data/core/services/webdav/Cargo.toml +2 -1
- data/core/services/webdav/LICENSE +201 -0
- data/core/services/webdav/NOTICE +5 -0
- data/core/services/webdav/README.md +56 -0
- data/core/services/webdav/src/backend.rs +1 -1
- data/core/services/webdav/src/docs.md +7 -7
- data/core/services/webdav/src/lib.rs +12 -2
- data/core/services/webhdfs/Cargo.toml +2 -1
- data/core/services/webhdfs/LICENSE +201 -0
- data/core/services/webhdfs/NOTICE +5 -0
- data/core/services/webhdfs/README.md +56 -0
- data/core/services/webhdfs/src/docs.md +11 -9
- data/core/services/webhdfs/src/lib.rs +12 -2
- data/core/services/yandex-disk/Cargo.toml +2 -1
- data/core/services/yandex-disk/LICENSE +201 -0
- data/core/services/yandex-disk/NOTICE +5 -0
- data/core/services/yandex-disk/README.md +56 -0
- data/core/services/yandex-disk/src/backend.rs +2 -2
- data/core/services/yandex-disk/src/docs.md +7 -5
- data/core/services/yandex-disk/src/lib.rs +9 -3
- data/core/src/lib.rs +30 -4
- data/core/testkit/Cargo.toml +5 -4
- data/core/testkit/LICENSE +201 -0
- data/core/testkit/NOTICE +5 -0
- data/core/testkit/README.md +25 -0
- data/core/testkit/src/lib.rs +4 -2
- data/core/testkit/src/read.rs +12 -13
- data/core/testkit/src/write.rs +12 -13
- data/core/tests/behavior/async_list.rs +2 -2
- data/core/tests/behavior/async_presign.rs +4 -4
- data/core/tests/behavior/async_stat.rs +1 -1
- data/core/tests/behavior/async_write.rs +1 -1
- data/core/users.md +2 -0
- data/opendal.gemspec +5 -1
- metadata +283 -2
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
//!
|
|
18
|
+
//! OpenDAL error types.
|
|
19
19
|
//!
|
|
20
20
|
//! # Examples
|
|
21
21
|
//!
|
|
@@ -42,10 +42,10 @@ use std::fmt::Display;
|
|
|
42
42
|
use std::fmt::Formatter;
|
|
43
43
|
use std::io;
|
|
44
44
|
|
|
45
|
-
/// Result
|
|
45
|
+
/// A specialized [`std::result::Result`] whose default error type is [`Error`].
|
|
46
46
|
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
|
47
47
|
|
|
48
|
-
///
|
|
48
|
+
/// OpenDAL error categories.
|
|
49
49
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
|
50
50
|
#[non_exhaustive]
|
|
51
51
|
pub enum ErrorKind {
|
|
@@ -55,7 +55,7 @@ pub enum ErrorKind {
|
|
|
55
55
|
/// Underlying service doesn't support this operation.
|
|
56
56
|
Unsupported,
|
|
57
57
|
|
|
58
|
-
/// The config for
|
|
58
|
+
/// The config for this service is invalid.
|
|
59
59
|
ConfigInvalid,
|
|
60
60
|
/// The given path is not found.
|
|
61
61
|
NotFound,
|
|
@@ -130,21 +130,26 @@ impl From<ErrorKind> for &'static str {
|
|
|
130
130
|
|
|
131
131
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
132
132
|
enum ErrorStatus {
|
|
133
|
-
///
|
|
133
|
+
/// The error is stable and will not change without external changes.
|
|
134
134
|
///
|
|
135
|
-
/// For example,
|
|
135
|
+
/// For example, a service returns a not found error.
|
|
136
136
|
///
|
|
137
137
|
/// Users MUST never retry this operation.
|
|
138
138
|
Permanent,
|
|
139
|
-
|
|
139
|
+
|
|
140
|
+
/// The error is temporary.
|
|
141
|
+
///
|
|
142
|
+
/// For example:
|
|
140
143
|
///
|
|
141
|
-
///
|
|
144
|
+
/// - A service rate-limits a request.
|
|
145
|
+
/// - A service is temporarily unavailable.
|
|
142
146
|
///
|
|
143
|
-
/// Users
|
|
147
|
+
/// Users MAY retry an operation to resolve this error.
|
|
144
148
|
Temporary,
|
|
145
|
-
|
|
149
|
+
|
|
150
|
+
/// The error was temporary but persisted after retries.
|
|
146
151
|
///
|
|
147
|
-
/// For example,
|
|
152
|
+
/// For example, a service kept returning network errors.
|
|
148
153
|
///
|
|
149
154
|
/// Users SHOULD NOT retry this operation, since it's highly possible to error again.
|
|
150
155
|
Persistent,
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
//! executors module provides implementations for the [`Execute`](crate::Execute) trait for widely used runtimes.
|
|
19
19
|
//!
|
|
20
|
-
//!
|
|
21
|
-
//! the
|
|
22
|
-
//! own executor by implementing the [`Execute`](crate::Execute) trait
|
|
20
|
+
//! OpenDAL provides executor integrations through features such as `executors-xxx`.
|
|
21
|
+
//! Enable the corresponding feature to select an executor. You can also provide
|
|
22
|
+
//! your own executor by implementing the [`Execute`](crate::Execute) trait.
|
|
23
23
|
|
|
24
24
|
#[cfg(feature = "executors-tokio")]
|
|
25
25
|
mod tokio_executor;
|
|
@@ -96,6 +96,12 @@ impl HttpTransporter {
|
|
|
96
96
|
/// Install the process-wide default HTTP transport.
|
|
97
97
|
///
|
|
98
98
|
/// The first installed transport wins. Later calls are ignored.
|
|
99
|
+
///
|
|
100
|
+
/// The `opendal` facade calls this before `main` when
|
|
101
|
+
/// `auto-register-services` and a default HTTP transport feature are enabled.
|
|
102
|
+
/// Applications that need to install their own process-wide default should
|
|
103
|
+
/// disable `auto-register-services`. This does not affect transports
|
|
104
|
+
/// configured directly on an operator.
|
|
99
105
|
pub fn install_default(transport: impl HttpTransport) {
|
|
100
106
|
let _ = DEFAULT_HTTP_TRANSPORTER.set(Self::new(transport));
|
|
101
107
|
}
|
data/core/core/src/types/list.rs
CHANGED
|
@@ -25,11 +25,10 @@ use futures::Stream;
|
|
|
25
25
|
use crate::raw::*;
|
|
26
26
|
use crate::*;
|
|
27
27
|
|
|
28
|
-
/// Lister
|
|
29
|
-
/// manner.
|
|
28
|
+
/// `Lister` lists entries at a given path asynchronously.
|
|
30
29
|
///
|
|
31
|
-
/// - Lister implements `Stream<Item = Result<Entry>>`.
|
|
32
|
-
/// - Lister
|
|
30
|
+
/// - `Lister` implements `Stream<Item = Result<Entry>>`.
|
|
31
|
+
/// - `Lister` returns `None` after it yields all entries or encounters an error.
|
|
33
32
|
pub struct Lister {
|
|
34
33
|
lister: Option<oio::Lister>,
|
|
35
34
|
|
|
@@ -39,7 +38,7 @@ pub struct Lister {
|
|
|
39
38
|
|
|
40
39
|
/// # Safety
|
|
41
40
|
///
|
|
42
|
-
///
|
|
41
|
+
/// All access to `Lister`'s internal state requires `&mut self`.
|
|
43
42
|
unsafe impl Sync for Lister {}
|
|
44
43
|
|
|
45
44
|
impl Lister {
|
|
@@ -65,7 +64,7 @@ impl Stream for Lister {
|
|
|
65
64
|
type Item = Result<Entry>;
|
|
66
65
|
|
|
67
66
|
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
|
68
|
-
// Returns `None` if we
|
|
67
|
+
// Returns `None` if we encountered an error.
|
|
69
68
|
if self.errored {
|
|
70
69
|
return Poll::Ready(None);
|
|
71
70
|
}
|
|
@@ -30,17 +30,19 @@ impl OperatorInfo {
|
|
|
30
30
|
Self { info, capability }
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
///
|
|
33
|
+
/// Return the operator's scheme.
|
|
34
34
|
pub fn scheme(&self) -> &'static str {
|
|
35
35
|
self.info.scheme()
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
///
|
|
38
|
+
/// Return the operator's root in a format like `/path/to/dir/`.
|
|
39
39
|
pub fn root(&self) -> String {
|
|
40
40
|
self.info.root().to_string()
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
///
|
|
43
|
+
/// Return the operator's name.
|
|
44
|
+
///
|
|
45
|
+
/// The name can be empty if the service has no namespace concept.
|
|
44
46
|
///
|
|
45
47
|
/// For example:
|
|
46
48
|
///
|
|
@@ -50,7 +52,7 @@ impl OperatorInfo {
|
|
|
50
52
|
self.info.name().to_string()
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
///
|
|
55
|
+
/// Return the operator's effective capabilities.
|
|
54
56
|
pub fn capability(&self) -> Capability {
|
|
55
57
|
self.capability
|
|
56
58
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
//!
|
|
18
|
+
//! This module organizes the `Operator` API into several submodules.
|
|
19
19
|
|
|
20
20
|
#[allow(clippy::module_inception)]
|
|
21
21
|
mod operator;
|
|
@@ -32,9 +32,37 @@ use crate::*;
|
|
|
32
32
|
/// For more details about the `Operator`, refer to the concepts section in the
|
|
33
33
|
/// crate documentation.
|
|
34
34
|
///
|
|
35
|
-
///
|
|
35
|
+
/// ## Immutability
|
|
36
|
+
///
|
|
37
|
+
/// `Operator` is immutable: methods that change layers, the HTTP transport, or the
|
|
36
38
|
/// executor return a new operator. Existing clones and in-flight operations keep
|
|
37
|
-
/// using the service stack and operation context they already hold.
|
|
39
|
+
/// using the service stack and operation context they already hold. For example,
|
|
40
|
+
/// a lister created before the operator is changed continues to use the previous
|
|
41
|
+
/// configuration.
|
|
42
|
+
///
|
|
43
|
+
/// ### Example
|
|
44
|
+
///
|
|
45
|
+
/// ```
|
|
46
|
+
/// use futures::TryStreamExt;
|
|
47
|
+
/// use opendal_core::services::Memory;
|
|
48
|
+
/// use opendal_core::{OperationContext, Operator, Result};
|
|
49
|
+
///
|
|
50
|
+
/// async fn example() -> Result<()> {
|
|
51
|
+
/// let op = Operator::new(Memory::default())?;
|
|
52
|
+
/// let mut lister = op.lister("/").await?;
|
|
53
|
+
///
|
|
54
|
+
/// // Replacing the context returns a new operator.
|
|
55
|
+
/// let new_op = op.with_context(OperationContext::new());
|
|
56
|
+
/// let _ = new_op.list("/").await?;
|
|
57
|
+
///
|
|
58
|
+
/// // The existing lister still uses the context it captured from `op`.
|
|
59
|
+
/// while let Some(entry) = lister.try_next().await? {
|
|
60
|
+
/// println!("{}", entry.path());
|
|
61
|
+
/// }
|
|
62
|
+
///
|
|
63
|
+
/// Ok(())
|
|
64
|
+
/// }
|
|
65
|
+
/// ```
|
|
38
66
|
///
|
|
39
67
|
/// Internally, an operator keeps base providers and composed dispatch state:
|
|
40
68
|
///
|
|
@@ -106,7 +134,8 @@ use crate::*;
|
|
|
106
134
|
///
|
|
107
135
|
/// ## Operate
|
|
108
136
|
///
|
|
109
|
-
/// After
|
|
137
|
+
/// After building an operator with the desired configuration and layers, users
|
|
138
|
+
/// can start operating on storage.
|
|
110
139
|
///
|
|
111
140
|
/// The operator is `Send`, `Sync`, and `Clone`. It holds immutable handles, and
|
|
112
141
|
/// storage operation APIs only take a `&self` reference, making it safe to share
|
|
@@ -789,7 +818,8 @@ impl Operator {
|
|
|
789
818
|
///
|
|
790
819
|
/// # Notes
|
|
791
820
|
///
|
|
792
|
-
///
|
|
821
|
+
/// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
|
|
822
|
+
/// for more details.
|
|
793
823
|
///
|
|
794
824
|
/// ## Extra Options
|
|
795
825
|
///
|
|
@@ -830,7 +860,8 @@ impl Operator {
|
|
|
830
860
|
///
|
|
831
861
|
/// # Notes
|
|
832
862
|
///
|
|
833
|
-
///
|
|
863
|
+
/// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
|
|
864
|
+
/// for more details.
|
|
834
865
|
///
|
|
835
866
|
/// ## Streaming Write
|
|
836
867
|
///
|
|
@@ -885,7 +916,8 @@ impl Operator {
|
|
|
885
916
|
///
|
|
886
917
|
/// # Notes
|
|
887
918
|
///
|
|
888
|
-
///
|
|
919
|
+
/// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
|
|
920
|
+
/// for more details.
|
|
889
921
|
///
|
|
890
922
|
/// ## Streaming Write
|
|
891
923
|
///
|
|
@@ -1015,7 +1047,8 @@ impl Operator {
|
|
|
1015
1047
|
/// [Capability](crate::types::Capability). However, you can override this by explicitly
|
|
1016
1048
|
/// setting the `chunk` parameter.
|
|
1017
1049
|
///
|
|
1018
|
-
///
|
|
1050
|
+
/// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
|
|
1051
|
+
/// for more details.
|
|
1019
1052
|
///
|
|
1020
1053
|
/// # Examples
|
|
1021
1054
|
///
|
|
@@ -1069,7 +1102,8 @@ impl Operator {
|
|
|
1069
1102
|
/// [Capability](crate::types::Capability). However, you can override this by explicitly
|
|
1070
1103
|
/// setting the `chunk` parameter.
|
|
1071
1104
|
///
|
|
1072
|
-
///
|
|
1105
|
+
/// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
|
|
1106
|
+
/// for more details.
|
|
1073
1107
|
///
|
|
1074
1108
|
/// # Examples
|
|
1075
1109
|
///
|
|
@@ -26,14 +26,13 @@ use crate::raw::*;
|
|
|
26
26
|
use crate::*;
|
|
27
27
|
use futures::Future;
|
|
28
28
|
|
|
29
|
-
///
|
|
29
|
+
/// [`Operator`] produces this future.
|
|
30
30
|
///
|
|
31
|
-
/// The future
|
|
31
|
+
/// The future consumes its inputs when it begins executing.
|
|
32
32
|
///
|
|
33
33
|
/// # NOTES
|
|
34
34
|
///
|
|
35
|
-
///
|
|
36
|
-
/// users to use this struct directly.
|
|
35
|
+
/// OpenDAL uses this type as an implementation detail. Users should not use it directly.
|
|
37
36
|
pub struct OperatorFuture<I, O, F: Future<Output = Result<O>>> {
|
|
38
37
|
/// The composed context used to execute operations.
|
|
39
38
|
ctx: OperationContext,
|
|
@@ -50,8 +49,7 @@ pub struct OperatorFuture<I, O, F: Future<Output = Result<O>>> {
|
|
|
50
49
|
impl<I, O, F: Future<Output = Result<O>>> OperatorFuture<I, O, F> {
|
|
51
50
|
/// # NOTES
|
|
52
51
|
///
|
|
53
|
-
///
|
|
54
|
-
/// users to use this struct directly.
|
|
52
|
+
/// OpenDAL uses this type as an implementation detail. Users should not use it directly.
|
|
55
53
|
pub(crate) fn new(
|
|
56
54
|
ctx: OperationContext,
|
|
57
55
|
srv: Servicer,
|
|
@@ -81,9 +79,9 @@ where
|
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
///
|
|
82
|
+
/// [`Operator::stat_with`] returns this future.
|
|
85
83
|
///
|
|
86
|
-
///
|
|
84
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
87
85
|
pub type FutureStat<F> = OperatorFuture<options::StatOptions, Metadata, F>;
|
|
88
86
|
|
|
89
87
|
impl<F: Future<Output = Result<Metadata>>> FutureStat<F> {
|
|
@@ -128,9 +126,9 @@ impl<F: Future<Output = Result<Metadata>>> FutureStat<F> {
|
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
|
|
131
|
-
///
|
|
129
|
+
/// [`Operator::presign_stat_with`] returns this future.
|
|
132
130
|
///
|
|
133
|
-
///
|
|
131
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
134
132
|
pub type FuturePresignStat<F> =
|
|
135
133
|
OperatorFuture<(options::StatOptions, Duration), PresignedRequest, F>;
|
|
136
134
|
|
|
@@ -166,17 +164,17 @@ impl<F: Future<Output = Result<PresignedRequest>>> FuturePresignStat<F> {
|
|
|
166
164
|
}
|
|
167
165
|
}
|
|
168
166
|
|
|
169
|
-
///
|
|
167
|
+
/// [`Operator::presign_delete_with`] returns this future.
|
|
170
168
|
///
|
|
171
|
-
///
|
|
169
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
172
170
|
pub type FuturePresignDelete<F> =
|
|
173
171
|
OperatorFuture<(options::DeleteOptions, Duration), PresignedRequest, F>;
|
|
174
172
|
|
|
175
173
|
impl<F: Future<Output = Result<PresignedRequest>>> FuturePresignDelete<F> {}
|
|
176
174
|
|
|
177
|
-
///
|
|
175
|
+
/// [`Operator::presign_read_with`] returns this future.
|
|
178
176
|
///
|
|
179
|
-
///
|
|
177
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
180
178
|
pub type FuturePresignRead<F> =
|
|
181
179
|
OperatorFuture<(options::ReadOptions, Duration), PresignedRequest, F>;
|
|
182
180
|
|
|
@@ -212,9 +210,9 @@ impl<F: Future<Output = Result<PresignedRequest>>> FuturePresignRead<F> {
|
|
|
212
210
|
}
|
|
213
211
|
}
|
|
214
212
|
|
|
215
|
-
///
|
|
213
|
+
/// [`Operator::presign_write_with`] returns this future.
|
|
216
214
|
///
|
|
217
|
-
///
|
|
215
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
218
216
|
pub type FuturePresignWrite<F> =
|
|
219
217
|
OperatorFuture<(options::WriteOptions, Duration), PresignedRequest, F>;
|
|
220
218
|
|
|
@@ -244,9 +242,9 @@ impl<F: Future<Output = Result<PresignedRequest>>> FuturePresignWrite<F> {
|
|
|
244
242
|
}
|
|
245
243
|
}
|
|
246
244
|
|
|
247
|
-
///
|
|
245
|
+
/// [`Operator::read_with`] returns this future.
|
|
248
246
|
///
|
|
249
|
-
///
|
|
247
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
250
248
|
pub type FutureRead<F> = OperatorFuture<options::ReadOptions, Buffer, F>;
|
|
251
249
|
|
|
252
250
|
impl<F: Future<Output = Result<Buffer>>> FutureRead<F> {
|
|
@@ -428,9 +426,9 @@ impl<F: Future<Output = Result<Buffer>>> FutureRead<F> {
|
|
|
428
426
|
}
|
|
429
427
|
}
|
|
430
428
|
|
|
431
|
-
///
|
|
429
|
+
/// [`Operator::read_with`] and [`Operator::reader_with`] return this future.
|
|
432
430
|
///
|
|
433
|
-
///
|
|
431
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
434
432
|
///
|
|
435
433
|
/// # Notes
|
|
436
434
|
///
|
|
@@ -628,9 +626,9 @@ impl<F: Future<Output = Result<Reader>>> FutureReader<F> {
|
|
|
628
626
|
}
|
|
629
627
|
}
|
|
630
628
|
|
|
631
|
-
///
|
|
629
|
+
/// [`Operator::write_with`] returns this future.
|
|
632
630
|
///
|
|
633
|
-
///
|
|
631
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
634
632
|
pub type FutureWrite<F> = OperatorFuture<(options::WriteOptions, Buffer), Metadata, F>;
|
|
635
633
|
|
|
636
634
|
impl<F: Future<Output = Result<Metadata>>> FutureWrite<F> {
|
|
@@ -927,9 +925,9 @@ impl<F: Future<Output = Result<Metadata>>> FutureWrite<F> {
|
|
|
927
925
|
}
|
|
928
926
|
}
|
|
929
927
|
|
|
930
|
-
///
|
|
928
|
+
/// [`Operator::writer_with`] returns this future.
|
|
931
929
|
///
|
|
932
|
-
///
|
|
930
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
933
931
|
pub type FutureWriter<F> = OperatorFuture<options::WriteOptions, Writer, F>;
|
|
934
932
|
|
|
935
933
|
impl<F: Future<Output = Result<Writer>>> FutureWriter<F> {
|
|
@@ -1266,9 +1264,9 @@ impl<F: Future<Output = Result<Writer>>> FutureWriter<F> {
|
|
|
1266
1264
|
}
|
|
1267
1265
|
}
|
|
1268
1266
|
|
|
1269
|
-
///
|
|
1267
|
+
/// [`Operator::delete_with`] returns this future.
|
|
1270
1268
|
///
|
|
1271
|
-
///
|
|
1269
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1272
1270
|
pub type FutureDelete<F> = OperatorFuture<options::DeleteOptions, (), F>;
|
|
1273
1271
|
|
|
1274
1272
|
impl<F: Future<Output = Result<()>>> FutureDelete<F> {
|
|
@@ -1285,14 +1283,14 @@ impl<F: Future<Output = Result<()>>> FutureDelete<F> {
|
|
|
1285
1283
|
}
|
|
1286
1284
|
}
|
|
1287
1285
|
|
|
1288
|
-
///
|
|
1286
|
+
/// This future creates a [`Deleter`].
|
|
1289
1287
|
///
|
|
1290
|
-
///
|
|
1288
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1291
1289
|
pub type FutureDeleter<F> = OperatorFuture<OpDeleter, (), F>;
|
|
1292
1290
|
|
|
1293
|
-
///
|
|
1291
|
+
/// [`Operator::list_with`] and [`Operator::lister_with`] return this future.
|
|
1294
1292
|
///
|
|
1295
|
-
///
|
|
1293
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1296
1294
|
pub type FutureList<F> = OperatorFuture<options::ListOptions, Vec<Entry>, F>;
|
|
1297
1295
|
|
|
1298
1296
|
impl<F: Future<Output = Result<Vec<Entry>>>> FutureList<F> {
|
|
@@ -1351,9 +1349,9 @@ impl<F: Future<Output = Result<Vec<Entry>>>> FutureList<F> {
|
|
|
1351
1349
|
}
|
|
1352
1350
|
}
|
|
1353
1351
|
|
|
1354
|
-
///
|
|
1352
|
+
/// [`Operator::list_with`] and [`Operator::lister_with`] return this future.
|
|
1355
1353
|
///
|
|
1356
|
-
///
|
|
1354
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1357
1355
|
pub type FutureLister<F> = OperatorFuture<options::ListOptions, Lister, F>;
|
|
1358
1356
|
|
|
1359
1357
|
impl<F: Future<Output = Result<Lister>>> FutureLister<F> {
|
|
@@ -1412,9 +1410,9 @@ impl<F: Future<Output = Result<Lister>>> FutureLister<F> {
|
|
|
1412
1410
|
}
|
|
1413
1411
|
}
|
|
1414
1412
|
|
|
1415
|
-
///
|
|
1413
|
+
/// [`Operator::copy_with`] returns this future.
|
|
1416
1414
|
///
|
|
1417
|
-
///
|
|
1415
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1418
1416
|
pub type FutureCopy<F> = OperatorFuture<(options::CopyOptions, String), Metadata, F>;
|
|
1419
1417
|
|
|
1420
1418
|
impl<F: Future<Output = Result<Metadata>>> FutureCopy<F> {
|
|
@@ -1483,9 +1481,9 @@ impl<F: Future<Output = Result<Metadata>>> FutureCopy<F> {
|
|
|
1483
1481
|
}
|
|
1484
1482
|
}
|
|
1485
1483
|
|
|
1486
|
-
///
|
|
1484
|
+
/// [`Operator::copier_with`] returns this future.
|
|
1487
1485
|
///
|
|
1488
|
-
///
|
|
1486
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1489
1487
|
pub type FutureCopier<F> = OperatorFuture<(options::CopyOptions, String), Copier, F>;
|
|
1490
1488
|
|
|
1491
1489
|
impl<F: Future<Output = Result<Copier>>> FutureCopier<F> {
|
|
@@ -1539,9 +1537,9 @@ impl<F: Future<Output = Result<Copier>>> FutureCopier<F> {
|
|
|
1539
1537
|
}
|
|
1540
1538
|
}
|
|
1541
1539
|
|
|
1542
|
-
///
|
|
1540
|
+
/// [`Operator::rename_with`] returns this future.
|
|
1543
1541
|
///
|
|
1544
|
-
///
|
|
1542
|
+
/// Use its methods to configure the operation before awaiting it.
|
|
1545
1543
|
pub type FutureRename<F> = OperatorFuture<(options::RenameOptions, String), (), F>;
|
|
1546
1544
|
|
|
1547
1545
|
impl<F: Future<Output = Result<()>>> FutureRename<F> {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
use crate::types::builder::{Builder, Configurator};
|
|
19
19
|
use crate::types::{IntoOperatorUri, OperatorUri};
|
|
20
20
|
use crate::{Error, ErrorKind, Operator, Result};
|
|
21
|
-
use std::collections::HashMap;
|
|
21
|
+
use std::collections::{HashMap, HashSet};
|
|
22
22
|
use std::sync::{LazyLock, Mutex};
|
|
23
23
|
|
|
24
24
|
/// Factory signature used to construct [`Operator`] from a URI and extra options.
|
|
@@ -35,10 +35,11 @@ impl OperatorRegistry {
|
|
|
35
35
|
pub fn get() -> &'static Self {
|
|
36
36
|
/// The global registry used by [`Operator::from_uri`].
|
|
37
37
|
///
|
|
38
|
-
///
|
|
39
|
-
/// and
|
|
38
|
+
/// OpenDAL always registers the `memory` service because OpenDAL uses it
|
|
39
|
+
/// extensively in unit tests and it has no dependencies.
|
|
40
40
|
///
|
|
41
|
-
///
|
|
41
|
+
/// The `opendal` facade crate registers other optional services. See
|
|
42
|
+
/// `core/src/lib.rs` in the facade crate for details.
|
|
42
43
|
static OPERATOR_REGISTRY: LazyLock<OperatorRegistry> = LazyLock::new(|| {
|
|
43
44
|
let factories = Mutex::new(HashMap::default());
|
|
44
45
|
let registry = OperatorRegistry { factories };
|
|
@@ -59,21 +60,53 @@ impl OperatorRegistry {
|
|
|
59
60
|
guard.insert(key, factory::<B::Config>);
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
/// Return the set of schemes currently registered.
|
|
64
|
+
///
|
|
65
|
+
/// For the global registry returned by [`OperatorRegistry::get`], this is
|
|
66
|
+
/// exactly the set of schemes that [`Operator::from_uri`] can construct, as
|
|
67
|
+
/// determined by the compiled-in `services-*` features.
|
|
68
|
+
///
|
|
69
|
+
/// ```
|
|
70
|
+
/// use opendal_core::OperatorRegistry;
|
|
71
|
+
///
|
|
72
|
+
/// let schemes = OperatorRegistry::get().schemes();
|
|
73
|
+
/// assert!(schemes.contains("memory"));
|
|
74
|
+
/// ```
|
|
75
|
+
pub fn schemes(&self) -> HashSet<String> {
|
|
76
|
+
self.factories
|
|
77
|
+
.lock()
|
|
78
|
+
.expect("operator registry mutex poisoned")
|
|
79
|
+
.keys()
|
|
80
|
+
.cloned()
|
|
81
|
+
.collect()
|
|
82
|
+
}
|
|
83
|
+
|
|
62
84
|
/// Load an [`Operator`] via the factory registered for the URI's scheme.
|
|
63
85
|
pub fn load(&self, uri: impl IntoOperatorUri) -> Result<Operator> {
|
|
64
86
|
let parsed = uri.into_operator_uri()?;
|
|
65
87
|
let scheme = parsed.scheme();
|
|
66
88
|
|
|
67
|
-
let factory =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
89
|
+
let factory = {
|
|
90
|
+
let guard = self
|
|
91
|
+
.factories
|
|
92
|
+
.lock()
|
|
93
|
+
.expect("operator registry mutex poisoned");
|
|
94
|
+
|
|
95
|
+
match guard.get(scheme).copied() {
|
|
96
|
+
Some(factory) => factory,
|
|
97
|
+
None => {
|
|
98
|
+
// Collect the available schemes from the guard we already hold
|
|
99
|
+
// to avoid re-locking the mutex (which would self-deadlock).
|
|
100
|
+
let mut available: Vec<String> = guard.keys().cloned().collect();
|
|
101
|
+
available.sort();
|
|
102
|
+
return Err(
|
|
103
|
+
Error::new(ErrorKind::Unsupported, "scheme is not registered")
|
|
104
|
+
.with_context("scheme", scheme.to_string())
|
|
105
|
+
.with_context("available", available.join(", ")),
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
77
110
|
|
|
78
111
|
factory(&parsed)
|
|
79
112
|
}
|
|
@@ -84,3 +117,29 @@ fn factory<C: Configurator>(uri: &OperatorUri) -> Result<Operator> {
|
|
|
84
117
|
let cfg = C::from_uri(uri)?;
|
|
85
118
|
Operator::from_config(cfg)
|
|
86
119
|
}
|
|
120
|
+
|
|
121
|
+
#[cfg(test)]
|
|
122
|
+
mod tests {
|
|
123
|
+
use super::*;
|
|
124
|
+
|
|
125
|
+
#[test]
|
|
126
|
+
fn global_registry_exposes_memory_scheme() {
|
|
127
|
+
let schemes = OperatorRegistry::get().schemes();
|
|
128
|
+
assert!(schemes.contains("memory"));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
#[test]
|
|
132
|
+
fn unregistered_scheme_error_lists_available_schemes() {
|
|
133
|
+
let err = OperatorRegistry::get()
|
|
134
|
+
.load("no-such-scheme://bucket/path")
|
|
135
|
+
.unwrap_err();
|
|
136
|
+
|
|
137
|
+
assert_eq!(err.kind(), ErrorKind::Unsupported);
|
|
138
|
+
|
|
139
|
+
let msg = err.to_string();
|
|
140
|
+
assert!(msg.contains("scheme is not registered"));
|
|
141
|
+
assert!(msg.contains("no-such-scheme"));
|
|
142
|
+
assert!(msg.contains("available"));
|
|
143
|
+
assert!(msg.contains("memory"));
|
|
144
|
+
}
|
|
145
|
+
}
|