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
data/core/core/src/raw/ops.rs
CHANGED
|
@@ -25,7 +25,7 @@ use crate::raw::*;
|
|
|
25
25
|
|
|
26
26
|
use std::collections::HashMap;
|
|
27
27
|
|
|
28
|
-
///
|
|
28
|
+
/// Arguments for `create` operation.
|
|
29
29
|
///
|
|
30
30
|
/// The path must be normalized.
|
|
31
31
|
#[derive(Debug, Clone, Default)]
|
|
@@ -38,12 +38,15 @@ impl OpCreateDir {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
///
|
|
41
|
+
/// Arguments for `delete` operation.
|
|
42
42
|
///
|
|
43
43
|
/// The path must be normalized.
|
|
44
44
|
#[derive(Debug, Clone, Default, Eq, Hash, PartialEq)]
|
|
45
45
|
pub struct OpDelete {
|
|
46
|
+
/// The version of the object to delete.
|
|
46
47
|
version: Option<String>,
|
|
48
|
+
|
|
49
|
+
/// Whether a `delete` is recursive.
|
|
47
50
|
recursive: bool,
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -55,7 +58,7 @@ impl OpDelete {
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
impl OpDelete {
|
|
58
|
-
///
|
|
61
|
+
/// Set the version of the object to delete.
|
|
59
62
|
pub fn with_version(mut self, version: &str) -> Self {
|
|
60
63
|
self.version = Some(version.into());
|
|
61
64
|
self
|
|
@@ -67,7 +70,7 @@ impl OpDelete {
|
|
|
67
70
|
self
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
///
|
|
73
|
+
/// Return the version of the object to delete.
|
|
71
74
|
pub fn version(&self) -> Option<&str> {
|
|
72
75
|
self.version.as_deref()
|
|
73
76
|
}
|
|
@@ -87,7 +90,7 @@ impl From<options::DeleteOptions> for OpDelete {
|
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
///
|
|
93
|
+
/// Arguments for `delete` operation.
|
|
91
94
|
///
|
|
92
95
|
/// The path must be normalized.
|
|
93
96
|
#[derive(Debug, Clone, Default)]
|
|
@@ -100,39 +103,43 @@ impl OpDeleter {
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
///
|
|
106
|
+
/// Arguments for `list` operation.
|
|
104
107
|
#[derive(Debug, Clone, Default)]
|
|
105
108
|
pub struct OpList {
|
|
106
|
-
/// The
|
|
107
|
-
/// that could return per-request.
|
|
109
|
+
/// The maximum number of results that the service should return per request.
|
|
108
110
|
///
|
|
109
|
-
///
|
|
111
|
+
/// This can be used to control the memory consumption of a list operation.
|
|
110
112
|
limit: Option<usize>,
|
|
111
|
-
|
|
112
|
-
///
|
|
113
|
+
|
|
114
|
+
/// The key after which the service should start listing.
|
|
113
115
|
start_after: Option<String>,
|
|
114
|
-
|
|
116
|
+
|
|
117
|
+
/// Whether the list operation is recursive.
|
|
115
118
|
///
|
|
116
|
-
/// - If `false`,
|
|
117
|
-
///
|
|
119
|
+
/// - If `false`, the operation lists only the immediate children of the given
|
|
120
|
+
/// path.
|
|
121
|
+
/// - If `true`, the operation lists all entries whose paths start with the
|
|
122
|
+
/// given path.
|
|
118
123
|
///
|
|
119
|
-
///
|
|
124
|
+
/// Defaults to `false`.
|
|
120
125
|
recursive: bool,
|
|
121
|
-
|
|
126
|
+
|
|
127
|
+
/// Whether to return object versions.
|
|
122
128
|
///
|
|
123
|
-
/// - If `false`,
|
|
124
|
-
/// - If `true`,
|
|
125
|
-
///
|
|
129
|
+
/// - If `false`, the operation does not return object versions.
|
|
130
|
+
/// - If `true`, the operation returns object versions when the service
|
|
131
|
+
/// supports versioning.
|
|
126
132
|
///
|
|
127
|
-
///
|
|
133
|
+
/// Defaults to `false`.
|
|
128
134
|
versions: bool,
|
|
129
|
-
|
|
135
|
+
|
|
136
|
+
/// Whether to return deleted objects.
|
|
130
137
|
///
|
|
131
|
-
/// - If `false`,
|
|
132
|
-
/// - If `true`,
|
|
133
|
-
///
|
|
138
|
+
/// - If `false`, the operation does not return deleted objects.
|
|
139
|
+
/// - If `true`, the operation returns deleted objects when the service
|
|
140
|
+
/// supports versioning.
|
|
134
141
|
///
|
|
135
|
-
///
|
|
142
|
+
/// Defaults to `false`.
|
|
136
143
|
deleted: bool,
|
|
137
144
|
}
|
|
138
145
|
|
|
@@ -142,40 +149,42 @@ impl OpList {
|
|
|
142
149
|
Self::default()
|
|
143
150
|
}
|
|
144
151
|
|
|
145
|
-
///
|
|
152
|
+
/// Set the maximum number of results per request.
|
|
146
153
|
pub fn with_limit(mut self, limit: usize) -> Self {
|
|
147
154
|
self.limit = Some(limit);
|
|
148
155
|
self
|
|
149
156
|
}
|
|
150
157
|
|
|
151
|
-
///
|
|
158
|
+
/// Return the maximum number of results per request.
|
|
152
159
|
pub fn limit(&self) -> Option<usize> {
|
|
153
160
|
self.limit
|
|
154
161
|
}
|
|
155
162
|
|
|
156
|
-
///
|
|
163
|
+
/// Set the key after which listing should start.
|
|
157
164
|
pub fn with_start_after(mut self, start_after: &str) -> Self {
|
|
158
165
|
self.start_after = Some(start_after.into());
|
|
159
166
|
self
|
|
160
167
|
}
|
|
161
168
|
|
|
162
|
-
///
|
|
169
|
+
/// Return the key after which listing should start.
|
|
163
170
|
pub fn start_after(&self) -> Option<&str> {
|
|
164
171
|
self.start_after.as_deref()
|
|
165
172
|
}
|
|
166
173
|
|
|
167
|
-
///
|
|
174
|
+
/// Set whether the list operation is recursive.
|
|
168
175
|
///
|
|
169
|
-
/// - If `false`,
|
|
170
|
-
///
|
|
176
|
+
/// - If `false`, the operation lists only the immediate children of the given
|
|
177
|
+
/// path.
|
|
178
|
+
/// - If `true`, the operation lists all entries whose paths start with the
|
|
179
|
+
/// given path.
|
|
171
180
|
///
|
|
172
|
-
///
|
|
181
|
+
/// Defaults to `false`.
|
|
173
182
|
pub fn with_recursive(mut self, recursive: bool) -> Self {
|
|
174
183
|
self.recursive = recursive;
|
|
175
184
|
self
|
|
176
185
|
}
|
|
177
186
|
|
|
178
|
-
///
|
|
187
|
+
/// Return whether the list operation is recursive.
|
|
179
188
|
pub fn recursive(&self) -> bool {
|
|
180
189
|
self.recursive
|
|
181
190
|
}
|
|
@@ -195,24 +204,24 @@ impl OpList {
|
|
|
195
204
|
0
|
|
196
205
|
}
|
|
197
206
|
|
|
198
|
-
///
|
|
207
|
+
/// Set whether to return object versions.
|
|
199
208
|
pub fn with_versions(mut self, versions: bool) -> Self {
|
|
200
209
|
self.versions = versions;
|
|
201
210
|
self
|
|
202
211
|
}
|
|
203
212
|
|
|
204
|
-
///
|
|
213
|
+
/// Return whether the operation includes object versions.
|
|
205
214
|
pub fn versions(&self) -> bool {
|
|
206
215
|
self.versions
|
|
207
216
|
}
|
|
208
217
|
|
|
209
|
-
///
|
|
218
|
+
/// Set whether to return deleted objects.
|
|
210
219
|
pub fn with_deleted(mut self, deleted: bool) -> Self {
|
|
211
220
|
self.deleted = deleted;
|
|
212
221
|
self
|
|
213
222
|
}
|
|
214
223
|
|
|
215
|
-
///
|
|
224
|
+
/// Return whether the operation includes deleted objects.
|
|
216
225
|
pub fn deleted(&self) -> bool {
|
|
217
226
|
self.deleted
|
|
218
227
|
}
|
|
@@ -230,7 +239,7 @@ impl From<options::ListOptions> for OpList {
|
|
|
230
239
|
}
|
|
231
240
|
}
|
|
232
241
|
|
|
233
|
-
///
|
|
242
|
+
/// Arguments for `presign` operation.
|
|
234
243
|
///
|
|
235
244
|
/// The path must be normalized.
|
|
236
245
|
#[derive(Debug, Clone)]
|
|
@@ -249,12 +258,12 @@ impl OpPresign {
|
|
|
249
258
|
}
|
|
250
259
|
}
|
|
251
260
|
|
|
252
|
-
///
|
|
261
|
+
/// Return the operation to presign.
|
|
253
262
|
pub fn operation(&self) -> &PresignOperation {
|
|
254
263
|
&self.op
|
|
255
264
|
}
|
|
256
265
|
|
|
257
|
-
///
|
|
266
|
+
/// Return the request expiration duration.
|
|
258
267
|
pub fn expire(&self) -> Duration {
|
|
259
268
|
self.expire
|
|
260
269
|
}
|
|
@@ -303,7 +312,7 @@ impl From<OpDelete> for PresignOperation {
|
|
|
303
312
|
}
|
|
304
313
|
}
|
|
305
314
|
|
|
306
|
-
///
|
|
315
|
+
/// Arguments for `read` operation.
|
|
307
316
|
#[derive(Debug, Clone, Default)]
|
|
308
317
|
pub struct OpRead {
|
|
309
318
|
if_match: Option<String>,
|
|
@@ -385,7 +394,7 @@ impl OpRead {
|
|
|
385
394
|
self
|
|
386
395
|
}
|
|
387
396
|
|
|
388
|
-
///
|
|
397
|
+
/// Return the If-Modified-Since condition.
|
|
389
398
|
pub fn if_modified_since(&self) -> Option<Timestamp> {
|
|
390
399
|
self.if_modified_since
|
|
391
400
|
}
|
|
@@ -417,12 +426,12 @@ impl OpRead {
|
|
|
417
426
|
}
|
|
418
427
|
}
|
|
419
428
|
|
|
420
|
-
///
|
|
429
|
+
/// Arguments for reader operation.
|
|
421
430
|
#[derive(Debug, Clone)]
|
|
422
431
|
pub struct OpReader {
|
|
423
|
-
/// The concurrent requests that reader can send.
|
|
432
|
+
/// The number of concurrent requests that reader can send.
|
|
424
433
|
concurrent: usize,
|
|
425
|
-
///
|
|
434
|
+
/// Request chunk size.
|
|
426
435
|
chunk: Option<usize>,
|
|
427
436
|
/// The gap size of each request.
|
|
428
437
|
gap: Option<usize>,
|
|
@@ -447,46 +456,46 @@ impl OpReader {
|
|
|
447
456
|
Self::default()
|
|
448
457
|
}
|
|
449
458
|
|
|
450
|
-
/// Set the
|
|
459
|
+
/// Set the number of concurrent requests the reader can send.
|
|
451
460
|
pub fn with_concurrent(mut self, concurrent: usize) -> Self {
|
|
452
461
|
self.concurrent = concurrent.max(1);
|
|
453
462
|
self
|
|
454
463
|
}
|
|
455
464
|
|
|
456
|
-
///
|
|
465
|
+
/// Return the number of concurrent requests.
|
|
457
466
|
pub fn concurrent(&self) -> usize {
|
|
458
467
|
self.concurrent
|
|
459
468
|
}
|
|
460
469
|
|
|
461
|
-
/// Set the chunk
|
|
470
|
+
/// Set the request chunk size.
|
|
462
471
|
pub fn with_chunk(mut self, chunk: usize) -> Self {
|
|
463
472
|
self.chunk = Some(chunk.max(1));
|
|
464
473
|
self
|
|
465
474
|
}
|
|
466
475
|
|
|
467
|
-
///
|
|
476
|
+
/// Return the request chunk size.
|
|
468
477
|
pub fn chunk(&self) -> Option<usize> {
|
|
469
478
|
self.chunk
|
|
470
479
|
}
|
|
471
480
|
|
|
472
|
-
/// Set the gap
|
|
481
|
+
/// Set the gap size.
|
|
473
482
|
pub fn with_gap(mut self, gap: usize) -> Self {
|
|
474
483
|
self.gap = Some(gap.max(1));
|
|
475
484
|
self
|
|
476
485
|
}
|
|
477
486
|
|
|
478
|
-
///
|
|
487
|
+
/// Return the gap size.
|
|
479
488
|
pub fn gap(&self) -> Option<usize> {
|
|
480
489
|
self.gap
|
|
481
490
|
}
|
|
482
491
|
|
|
483
|
-
/// Set the
|
|
492
|
+
/// Set the number of prefetch requests.
|
|
484
493
|
pub fn with_prefetch(mut self, prefetch: usize) -> Self {
|
|
485
494
|
self.prefetch = prefetch;
|
|
486
495
|
self
|
|
487
496
|
}
|
|
488
497
|
|
|
489
|
-
///
|
|
498
|
+
/// Return the number of prefetch requests.
|
|
490
499
|
pub fn prefetch(&self) -> usize {
|
|
491
500
|
self.prefetch
|
|
492
501
|
}
|
|
@@ -543,7 +552,7 @@ impl From<options::ReaderOptions> for (OpRead, OpReader) {
|
|
|
543
552
|
}
|
|
544
553
|
}
|
|
545
554
|
|
|
546
|
-
///
|
|
555
|
+
/// Arguments for `stat` operation.
|
|
547
556
|
#[derive(Debug, Clone, Default)]
|
|
548
557
|
pub struct OpStat {
|
|
549
558
|
if_match: Option<String>,
|
|
@@ -667,7 +676,7 @@ impl From<options::StatOptions> for OpStat {
|
|
|
667
676
|
}
|
|
668
677
|
}
|
|
669
678
|
|
|
670
|
-
///
|
|
679
|
+
/// Arguments for `write` operation.
|
|
671
680
|
#[derive(Debug, Clone, Default)]
|
|
672
681
|
pub struct OpWrite {
|
|
673
682
|
append: bool,
|
|
@@ -703,7 +712,7 @@ impl OpWrite {
|
|
|
703
712
|
///
|
|
704
713
|
/// # Notes
|
|
705
714
|
///
|
|
706
|
-
/// Service could return `Unsupported` if the
|
|
715
|
+
/// Service could return `Unsupported` if the storage does not support append.
|
|
707
716
|
pub fn with_append(mut self, append: bool) -> Self {
|
|
708
717
|
self.append = append;
|
|
709
718
|
self
|
|
@@ -809,7 +818,7 @@ impl OpWrite {
|
|
|
809
818
|
}
|
|
810
819
|
}
|
|
811
820
|
|
|
812
|
-
///
|
|
821
|
+
/// Arguments for `writer` operation.
|
|
813
822
|
#[derive(Debug, Clone, Default)]
|
|
814
823
|
pub struct OpWriter {
|
|
815
824
|
chunk: Option<usize>,
|
|
@@ -864,7 +873,7 @@ impl From<options::WriteOptions> for (OpWrite, OpWriter) {
|
|
|
864
873
|
}
|
|
865
874
|
}
|
|
866
875
|
|
|
867
|
-
///
|
|
876
|
+
/// Arguments for `copy` operation.
|
|
868
877
|
#[derive(Debug, Clone, Default)]
|
|
869
878
|
pub struct OpCopy {
|
|
870
879
|
if_not_exists: bool,
|
|
@@ -920,7 +929,7 @@ impl OpCopy {
|
|
|
920
929
|
}
|
|
921
930
|
}
|
|
922
931
|
|
|
923
|
-
///
|
|
932
|
+
/// Arguments for `copier` operation.
|
|
924
933
|
#[derive(Debug, Clone, Default)]
|
|
925
934
|
pub struct OpCopier {
|
|
926
935
|
concurrent: usize,
|
|
@@ -985,9 +994,13 @@ impl From<options::CopyOptions> for (OpCopy, OpCopier) {
|
|
|
985
994
|
}
|
|
986
995
|
}
|
|
987
996
|
|
|
988
|
-
///
|
|
997
|
+
/// Arguments for `rename` operation.
|
|
989
998
|
#[derive(Debug, Clone, Default)]
|
|
990
999
|
pub struct OpRename {
|
|
1000
|
+
/// Whether the rename should fail when the destination already exists.
|
|
1001
|
+
///
|
|
1002
|
+
/// If `true`, the rename succeeds only when the destination does not exist.
|
|
1003
|
+
/// If `false`, the rename uses OpenDAL's default overwrite behavior.
|
|
991
1004
|
if_not_exists: bool,
|
|
992
1005
|
}
|
|
993
1006
|
|
|
@@ -997,13 +1010,22 @@ impl OpRename {
|
|
|
997
1010
|
Self::default()
|
|
998
1011
|
}
|
|
999
1012
|
|
|
1000
|
-
/// Set the
|
|
1013
|
+
/// Set whether the rename should fail when the destination already exists.
|
|
1014
|
+
///
|
|
1015
|
+
/// If `true`, the rename succeeds only when the destination does not exist.
|
|
1016
|
+
/// If `false`, the rename uses OpenDAL's default overwrite behavior.
|
|
1017
|
+
///
|
|
1018
|
+
/// ## Service Implementation
|
|
1019
|
+
///
|
|
1020
|
+
/// Check [`crate::Capability::rename_with_if_not_exists`] before setting this to
|
|
1021
|
+
/// `true`. A service might return `ErrorKind::Unsupported` if it cannot
|
|
1022
|
+
/// enforce the condition.
|
|
1001
1023
|
pub fn with_if_not_exists(mut self, if_not_exists: bool) -> Self {
|
|
1002
1024
|
self.if_not_exists = if_not_exists;
|
|
1003
1025
|
self
|
|
1004
1026
|
}
|
|
1005
1027
|
|
|
1006
|
-
///
|
|
1028
|
+
/// Return whether the rename should fail when the destination already exists.
|
|
1007
1029
|
pub fn if_not_exists(&self) -> bool {
|
|
1008
1030
|
self.if_not_exists
|
|
1009
1031
|
}
|
|
@@ -58,8 +58,40 @@ pub(crate) fn format_std_io_error(err: Error) -> io::Error {
|
|
|
58
58
|
let kind = match err.kind() {
|
|
59
59
|
ErrorKind::NotFound => io::ErrorKind::NotFound,
|
|
60
60
|
ErrorKind::PermissionDenied => io::ErrorKind::PermissionDenied,
|
|
61
|
-
_ => io::ErrorKind::
|
|
61
|
+
_ => io::ErrorKind::Other,
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
io::Error::new(kind, err)
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
#[cfg(test)]
|
|
68
|
+
mod tests {
|
|
69
|
+
use super::*;
|
|
70
|
+
|
|
71
|
+
#[test]
|
|
72
|
+
fn test_read_to_end_stops_on_persistent_error() {
|
|
73
|
+
struct ErrorThenEof {
|
|
74
|
+
calls: usize,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
impl io::Read for ErrorThenEof {
|
|
78
|
+
fn read(&mut self, _: &mut [u8]) -> io::Result<usize> {
|
|
79
|
+
self.calls += 1;
|
|
80
|
+
if self.calls == 1 {
|
|
81
|
+
return Err(format_std_io_error(
|
|
82
|
+
Error::new(ErrorKind::Unexpected, "retry exhausted").set_persistent(),
|
|
83
|
+
));
|
|
84
|
+
}
|
|
85
|
+
Ok(0)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let mut reader = ErrorThenEof { calls: 0 };
|
|
90
|
+
let mut buf = Vec::new();
|
|
91
|
+
assert!(
|
|
92
|
+
io::Read::read_to_end(&mut reader, &mut buf).is_err(),
|
|
93
|
+
"calls: {}",
|
|
94
|
+
reader.calls
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
///
|
|
18
|
+
/// URI scheme used for memory service registration and URI construction.
|
|
19
19
|
pub const MEMORY_SCHEME: &str = "memory";
|
|
20
20
|
|
|
21
21
|
mod backend;
|
|
@@ -28,7 +28,11 @@ mod writer;
|
|
|
28
28
|
pub use backend::MemoryBuilder as Memory;
|
|
29
29
|
pub use config::MemoryConfig;
|
|
30
30
|
|
|
31
|
-
/// Register
|
|
31
|
+
/// Register the memory URI scheme with an operator registry.
|
|
32
|
+
///
|
|
33
|
+
/// Registration enables scheme-driven construction through
|
|
34
|
+
/// [`crate::Operator::from_uri`] and [`crate::Operator::via_iter`]. Direct
|
|
35
|
+
/// construction through [`crate::Operator::new`] does not require registration.
|
|
32
36
|
pub fn register_memory_service(registry: &crate::OperatorRegistry) {
|
|
33
37
|
registry.register::<Memory>(MEMORY_SCHEME);
|
|
34
38
|
}
|
|
@@ -15,9 +15,15 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
//!
|
|
18
|
+
//! Built-in service support.
|
|
19
19
|
//!
|
|
20
|
-
//!
|
|
20
|
+
//! [`Memory`] is the only storage service implemented by `opendal-core`
|
|
21
|
+
//! directly. Other services live in `opendal-service-*` crates and are
|
|
22
|
+
//! re-exported by the `opendal` facade behind `services-*` Cargo features.
|
|
23
|
+
//!
|
|
24
|
+
//! Pass a builder directly to [`crate::Operator::new`]. Service registration is
|
|
25
|
+
//! only required for scheme-driven construction through
|
|
26
|
+
//! [`crate::Operator::from_uri`] or [`crate::Operator::via_iter`].
|
|
21
27
|
|
|
22
28
|
mod memory;
|
|
23
29
|
pub use self::memory::*;
|
|
@@ -44,14 +44,14 @@ use crate::*;
|
|
|
44
44
|
|
|
45
45
|
/// Buffer is a wrapper of contiguous `Bytes` and non-contiguous `[Bytes]`.
|
|
46
46
|
///
|
|
47
|
-
///
|
|
48
|
-
///
|
|
47
|
+
/// Buffer supports non-contiguous bytes that a storage service returns. For example,
|
|
48
|
+
/// HTTP-based services such as S3 can produce non-contiguous bytes while streaming.
|
|
49
49
|
///
|
|
50
50
|
/// ## Features
|
|
51
51
|
///
|
|
52
52
|
/// - [`Buffer`] can be used as [`Buf`], [`Iterator`], [`Stream`] directly.
|
|
53
53
|
/// - [`Buffer`] is cheap to clone like [`Bytes`], only update reference count, no allocation.
|
|
54
|
-
/// - [`Buffer`]
|
|
54
|
+
/// - Convert [`Buffer`] to [`IoSlice`] for vectored writes.
|
|
55
55
|
///
|
|
56
56
|
/// ## Examples
|
|
57
57
|
///
|
|
@@ -246,7 +246,7 @@ impl Buffer {
|
|
|
246
246
|
|
|
247
247
|
/// Returns a slice of self for the provided range.
|
|
248
248
|
///
|
|
249
|
-
/// This
|
|
249
|
+
/// This increments the reference count for the underlying memory and returns a new Buffer handle for the slice.
|
|
250
250
|
///
|
|
251
251
|
/// This operation is O(1).
|
|
252
252
|
pub fn slice(&self, range: impl RangeBounds<usize>) -> Self {
|
|
@@ -24,23 +24,22 @@ use crate::raw::*;
|
|
|
24
24
|
use crate::types::OperatorUri;
|
|
25
25
|
use crate::*;
|
|
26
26
|
|
|
27
|
-
///
|
|
27
|
+
/// OpenDAL uses `Builder` to set up a service.
|
|
28
28
|
///
|
|
29
|
-
///
|
|
29
|
+
/// A `Builder` allows developers to:
|
|
30
30
|
///
|
|
31
|
-
/// -
|
|
32
|
-
/// -
|
|
31
|
+
/// - Build a service through a builder-style API.
|
|
32
|
+
/// - Configure in-memory options, such as `customized_credential_load`.
|
|
33
33
|
///
|
|
34
|
-
///
|
|
35
|
-
///
|
|
36
|
-
/// For example:
|
|
34
|
+
/// Users can usually use the [`Operator`] API instead of importing and using
|
|
35
|
+
/// `Builder` directly. For example:
|
|
37
36
|
///
|
|
38
37
|
/// ```
|
|
39
38
|
/// # use anyhow::Result;
|
|
40
39
|
/// use opendal_core::services::Memory;
|
|
41
40
|
/// use opendal_core::Operator;
|
|
42
41
|
/// async fn test() -> Result<()> {
|
|
43
|
-
/// // Create memory backend builder.
|
|
42
|
+
/// // Create a memory backend builder.
|
|
44
43
|
/// let builder = Memory::default();
|
|
45
44
|
///
|
|
46
45
|
/// // Build an `Operator` to start operating the storage.
|
|
@@ -50,7 +49,7 @@ use crate::*;
|
|
|
50
49
|
/// }
|
|
51
50
|
/// ```
|
|
52
51
|
pub trait Builder: Default + 'static {
|
|
53
|
-
/// Associated configuration
|
|
52
|
+
/// Associated configuration.
|
|
54
53
|
type Config: Configurator;
|
|
55
54
|
|
|
56
55
|
/// Consume the builder to build a service.
|
|
@@ -66,16 +65,15 @@ impl Builder for () {
|
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
///
|
|
68
|
+
/// OpenDAL uses `Configurator` to configure a service.
|
|
70
69
|
///
|
|
71
70
|
/// This trait allows the developer to define a configuration struct that can:
|
|
72
71
|
///
|
|
73
|
-
/// -
|
|
74
|
-
/// -
|
|
75
|
-
///
|
|
76
|
-
/// Usually, users don't need to use or import this trait directly, they can use `Operator` API instead.
|
|
72
|
+
/// - Deserialize from an iterator such as a hash map or vector.
|
|
73
|
+
/// - Convert into a service builder and then build a concrete service.
|
|
77
74
|
///
|
|
78
|
-
///
|
|
75
|
+
/// Users can usually use the [`Operator`] API instead of importing and using
|
|
76
|
+
/// `Configurator` directly. For example:
|
|
79
77
|
///
|
|
80
78
|
/// ```
|
|
81
79
|
/// # use anyhow::Result;
|
|
@@ -97,14 +95,14 @@ pub trait Configurator: Serialize + DeserializeOwned + Debug + 'static {
|
|
|
97
95
|
/// Associated builder for this configuration.
|
|
98
96
|
type Builder: Builder;
|
|
99
97
|
|
|
100
|
-
/// Build configuration from a parsed URI
|
|
98
|
+
/// Build configuration from a parsed URI with merged options.
|
|
101
99
|
fn from_uri(_uri: &OperatorUri) -> Result<Self> {
|
|
102
100
|
Err(Error::new(ErrorKind::Unsupported, "uri is not supported"))
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
/// Deserialize from an iterator.
|
|
106
104
|
///
|
|
107
|
-
///
|
|
105
|
+
/// OpenDAL provides this method; service developers should not need to override it.
|
|
108
106
|
fn from_iter(iter: impl IntoIterator<Item = (String, String)>) -> Result<Self> {
|
|
109
107
|
let cfg = ConfigDeserializer::new(iter.into_iter().collect());
|
|
110
108
|
|
data/core/core/src/types/copy.rs
CHANGED
|
@@ -26,9 +26,9 @@ use futures::Stream;
|
|
|
26
26
|
use crate::raw::*;
|
|
27
27
|
use crate::*;
|
|
28
28
|
|
|
29
|
-
/// Copier
|
|
29
|
+
/// `Copier` drives a long-running copy operation one step at a time.
|
|
30
30
|
///
|
|
31
|
-
/// - Copier implements `Stream<Item = Result<usize>>`.
|
|
31
|
+
/// - `Copier` implements `Stream<Item = Result<usize>>`.
|
|
32
32
|
/// - `Some(Ok(n))` means the copy operation made progress by `n` bytes.
|
|
33
33
|
/// - `None` means the copy operation has completed.
|
|
34
34
|
pub struct Copier {
|
|
@@ -74,7 +74,7 @@ impl Copier {
|
|
|
74
74
|
})
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
///
|
|
77
|
+
/// Advance the copy operation by one step.
|
|
78
78
|
pub async fn next(&mut self) -> Result<Option<usize>> {
|
|
79
79
|
if self.errored {
|
|
80
80
|
return Ok(None);
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
use crate::raw::*;
|
|
19
19
|
use crate::*;
|
|
20
20
|
|
|
21
|
-
/// Entry
|
|
21
|
+
/// `Entry` represents an entry's path and metadata.
|
|
22
|
+
///
|
|
23
|
+
/// [`Lister`] and [`crate::blocking::Lister`] return `Entry` values.
|
|
22
24
|
#[derive(Clone, Debug)]
|
|
23
25
|
pub struct Entry {
|
|
24
26
|
/// Path of this entry.
|