You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/07/27 07:22:46 UTC
(opendal) 01/01: docs: align Rust crate and API docs
This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch xuanwo/align-rust-crate-docs
in repository https://gitbox.apache.org/repos/asf/opendal.git
commit 38691233046fa4d9b05dcbc077aad78ec77e1272
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Mon Jul 27 15:22:19 2026 +0800
docs: align Rust crate and API docs
---
.github/workflows/ci_core.yml | 13 +-
.github/workflows/docs.yml | 14 ++-
core/README.md | 17 ++-
core/core/Cargo.toml | 1 -
core/core/README.md | 6 +-
core/core/src/blocking/delete.rs | 4 +-
core/core/src/blocking/list.rs | 3 +-
core/core/src/blocking/operator.rs | 15 ++-
core/core/src/blocking/read/std_bytes_iterator.rs | 3 +-
core/core/src/blocking/read/std_reader.rs | 3 +-
core/core/src/blocking/write/std_writer.rs | 2 +-
core/core/src/layers/mod.rs | 7 +-
core/core/src/lib.rs | 139 +---------------------
core/core/src/raw/ops.rs | 2 +-
core/core/src/services/memory/mod.rs | 8 +-
core/core/src/services/mod.rs | 10 +-
core/core/src/types/entry.rs | 2 +-
core/core/src/types/operator/operator.rs | 15 ++-
core/core/src/types/options.rs | 90 +++++++-------
core/core/src/types/read/reader.rs | 3 +-
core/core/src/types/write/writer.rs | 3 +-
core/http-transports/reqwest/README.md | 8 +-
core/http-transports/reqwest/src/lib.rs | 53 +--------
core/layers/async-backtrace/src/lib.rs | 5 +-
core/layers/await-tree/src/lib.rs | 5 +-
core/layers/capability-check/src/lib.rs | 5 +-
core/layers/chaos/src/lib.rs | 5 +-
core/layers/concurrent-limit/src/lib.rs | 5 +-
core/layers/dtrace/src/lib.rs | 5 +-
core/layers/fastmetrics/src/lib.rs | 5 +-
core/layers/fastrace/src/lib.rs | 5 +-
core/layers/foyer/src/deleter.rs | 1 +
core/layers/foyer/src/lib.rs | 20 +++-
core/layers/foyer/src/writer.rs | 1 +
core/layers/hotpath/src/lib.rs | 5 +-
core/layers/immutable-index/src/lib.rs | 5 +-
core/layers/logging/src/lib.rs | 5 +-
core/layers/metrics/src/lib.rs | 5 +-
core/layers/mime-guess/src/lib.rs | 5 +-
core/layers/observe-metrics-common/src/lib.rs | 24 ++--
core/layers/otelmetrics/src/lib.rs | 5 +-
core/layers/oteltrace/README.md | 3 +-
core/layers/oteltrace/src/lib.rs | 18 ++-
core/layers/prometheus-client/src/lib.rs | 5 +-
core/layers/prometheus/src/lib.rs | 5 +-
core/layers/retry/src/lib.rs | 5 +-
core/layers/route/README.md | 10 ++
core/layers/route/src/lib.rs | 49 ++++++--
core/layers/tail-cut/src/lib.rs | 5 +-
core/layers/throttle/src/lib.rs | 5 +-
core/layers/timeout/src/lib.rs | 5 +-
core/layers/tracing/src/lib.rs | 5 +-
core/services/aliyun-drive/src/docs.md | 16 ++-
core/services/aliyun-drive/src/lib.rs | 14 ++-
core/services/alluxio/src/docs.md | 12 +-
core/services/alluxio/src/lib.rs | 14 ++-
core/services/azblob/src/docs.md | 16 ++-
core/services/azblob/src/lib.rs | 16 ++-
core/services/azdls/src/docs.md | 15 ++-
core/services/azdls/src/lib.rs | 14 ++-
core/services/azfile/src/docs.md | 15 ++-
core/services/azfile/src/lib.rs | 14 ++-
core/services/azure-common/src/lib.rs | 7 +-
core/services/b2/src/docs.md | 15 ++-
core/services/b2/src/lib.rs | 12 +-
core/services/cacache/src/docs.md | 11 +-
core/services/cacache/src/lib.rs | 13 +-
core/services/cloudflare-kv/src/docs.md | 12 +-
core/services/cloudflare-kv/src/lib.rs | 12 +-
core/services/compfs/src/lib.rs | 12 +-
core/services/cos/src/docs.md | 16 ++-
core/services/cos/src/lib.rs | 14 ++-
core/services/d1/src/docs.md | 15 ++-
core/services/d1/src/lib.rs | 12 +-
core/services/dashmap/src/docs.md | 11 +-
core/services/dashmap/src/lib.rs | 13 +-
core/services/dbfs/src/docs.md | 13 +-
core/services/dbfs/src/lib.rs | 13 +-
core/services/dropbox/src/docs.md | 11 +-
core/services/dropbox/src/lib.rs | 13 +-
core/services/etcd/src/docs.md | 17 ++-
core/services/etcd/src/lib.rs | 13 +-
core/services/foundationdb/src/docs.md | 12 +-
core/services/foundationdb/src/lib.rs | 13 +-
core/services/foyer/README.md | 5 +-
core/services/foyer/src/docs.md | 13 +-
core/services/foyer/src/lib.rs | 20 ++--
core/services/fs/src/docs.md | 12 +-
core/services/fs/src/lib.rs | 12 +-
core/services/ftp/src/docs.md | 14 +--
core/services/ftp/src/lib.rs | 14 ++-
core/services/gcs/src/docs.md | 20 ++--
core/services/gcs/src/lib.rs | 12 +-
core/services/gdrive/src/docs.md | 13 +-
core/services/gdrive/src/lib.rs | 14 ++-
core/services/ghac/src/docs.md | 11 +-
core/services/ghac/src/lib.rs | 14 ++-
core/services/github/src/docs.md | 15 ++-
core/services/github/src/lib.rs | 14 ++-
core/services/goosefs/src/docs.md | 17 ++-
core/services/goosefs/src/lib.rs | 14 ++-
core/services/gridfs/src/docs.md | 13 +-
core/services/gridfs/src/lib.rs | 13 +-
core/services/hdfs-native/src/backend.rs | 3 +-
core/services/hdfs-native/src/docs.md | 11 +-
core/services/hdfs-native/src/lib.rs | 14 ++-
core/services/hdfs/src/docs.md | 18 +--
core/services/hdfs/src/lib.rs | 14 ++-
core/services/hf/src/backend.rs | 8 +-
core/services/hf/src/config.rs | 2 +-
core/services/hf/src/docs.md | 23 ++--
core/services/hf/src/lib.rs | 16 ++-
core/services/http/src/docs.md | 12 +-
core/services/http/src/lib.rs | 14 ++-
core/services/ipfs/src/docs.md | 12 +-
core/services/ipfs/src/lib.rs | 12 +-
core/services/ipmfs/src/docs.md | 11 +-
core/services/ipmfs/src/lib.rs | 14 ++-
core/services/koofr/src/docs.md | 14 +--
core/services/koofr/src/lib.rs | 14 ++-
core/services/lakefs/src/docs.md | 16 ++-
core/services/lakefs/src/lib.rs | 13 +-
core/services/memcached/Cargo.toml | 2 +-
core/services/memcached/src/docs.md | 15 ++-
core/services/memcached/src/lib.rs | 13 +-
core/services/mini_moka/src/docs.md | 11 +-
core/services/mini_moka/src/lib.rs | 13 +-
core/services/moka/src/docs.md | 14 +--
core/services/moka/src/lib.rs | 12 +-
core/services/mongodb/src/docs.md | 14 +--
core/services/mongodb/src/lib.rs | 14 ++-
core/services/monoiofs/src/docs.md | 11 +-
core/services/monoiofs/src/lib.rs | 13 +-
core/services/mysql/src/docs.md | 13 +-
core/services/mysql/src/lib.rs | 14 ++-
core/services/obs/src/docs.md | 16 ++-
core/services/obs/src/lib.rs | 14 ++-
core/services/onedrive/src/docs.md | 20 ++--
core/services/onedrive/src/lib.rs | 12 +-
core/services/opfs/Cargo.toml | 2 +
core/services/opfs/src/docs.md | 8 +-
core/services/opfs/src/lib.rs | 13 +-
core/services/oss/src/docs.md | 32 ++---
core/services/oss/src/lib.rs | 12 +-
core/services/pcloud/src/docs.md | 14 +--
core/services/pcloud/src/lib.rs | 12 +-
core/services/persy/src/docs.md | 13 +-
core/services/persy/src/lib.rs | 12 +-
core/services/postgresql/src/docs.md | 13 +-
core/services/postgresql/src/lib.rs | 14 ++-
core/services/redb/src/docs.md | 12 +-
core/services/redb/src/lib.rs | 12 +-
core/services/redis/src/docs.md | 16 ++-
core/services/redis/src/lib.rs | 13 +-
core/services/rocksdb/src/docs.md | 12 +-
core/services/rocksdb/src/lib.rs | 14 ++-
core/services/s3/src/docs.md | 35 ++----
core/services/s3/src/lib.rs | 12 +-
core/services/seafile/src/docs.md | 15 ++-
core/services/seafile/src/lib.rs | 14 ++-
core/services/sftp/src/docs.md | 16 ++-
core/services/sftp/src/lib.rs | 13 +-
core/services/sled/src/docs.md | 11 +-
core/services/sled/src/lib.rs | 14 ++-
core/services/sqlite/src/docs.md | 13 +-
core/services/sqlite/src/lib.rs | 14 ++-
core/services/surrealdb/src/docs.md | 18 ++-
core/services/surrealdb/src/lib.rs | 12 +-
core/services/swift/src/docs.md | 13 +-
core/services/swift/src/lib.rs | 13 +-
core/services/tikv/src/docs.md | 15 ++-
core/services/tikv/src/lib.rs | 14 ++-
core/services/tos/src/docs.md | 17 ++-
core/services/tos/src/lib.rs | 12 +-
core/services/upyun/src/docs.md | 14 +--
core/services/upyun/src/lib.rs | 13 +-
core/services/vercel-artifacts/src/docs.md | 14 +--
core/services/vercel-artifacts/src/lib.rs | 14 ++-
core/services/vercel-blob/src/docs.md | 12 +-
core/services/vercel-blob/src/lib.rs | 14 ++-
core/services/webdav/src/docs.md | 14 +--
core/services/webdav/src/lib.rs | 14 ++-
core/services/webhdfs/src/docs.md | 20 ++--
core/services/webhdfs/src/lib.rs | 14 ++-
core/services/yandex-disk/src/docs.md | 12 +-
core/services/yandex-disk/src/lib.rs | 12 +-
core/src/lib.rs | 20 +++-
core/testkit/src/lib.rs | 6 +-
core/testkit/src/read.rs | 25 ++--
core/testkit/src/write.rs | 25 ++--
190 files changed, 1489 insertions(+), 1049 deletions(-)
diff --git a/.github/workflows/ci_core.yml b/.github/workflows/ci_core.yml
index 3aadf701fd..34d6cfacf0 100644
--- a/.github/workflows/ci_core.yml
+++ b/.github/workflows/ci_core.yml
@@ -51,9 +51,20 @@ jobs:
distribution: zulu
java-version: 25
+ - name: Add wasm target
+ run: rustup target add wasm32-unknown-unknown
+
- name: Cargo doc
working-directory: core
- run: cargo doc --lib --no-deps --all-features
+ env:
+ RUSTDOCFLAGS: >-
+ -D rustdoc::broken_intra_doc_links
+ -D rustdoc::invalid_rust_codeblocks
+ -D rustdoc::bare_urls
+ run: |
+ cargo doc --workspace --lib --no-deps --all-features
+ cargo doc --package opendal-service-opfs --lib --no-deps --all-features \
+ --target wasm32-unknown-unknown
check_clippy:
runs-on: ubuntu-latest
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 468926cbb2..05b47d3712 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -44,7 +44,11 @@ env:
# Check this page for updating: https://docs.rs/crate/opendal/latest/builds
RUST_DOC_TOOLCHAIN: nightly-2026-04-30
# Enable cfg docsrs to make sure docs are built.
- RUSTDOCFLAGS: "--cfg docsrs"
+ RUSTDOCFLAGS: >-
+ --cfg docsrs
+ -D rustdoc::broken_intra_doc_links
+ -D rustdoc::invalid_rust_codeblocks
+ -D rustdoc::bare_urls
jobs:
build-rust-doc:
@@ -63,6 +67,7 @@ jobs:
- name: Setup Rust Nightly
run: |
rustup toolchain install ${{ env.RUST_DOC_TOOLCHAIN }}
+ rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_DOC_TOOLCHAIN }}
- uses: actions/setup-java@v5
with:
@@ -71,7 +76,12 @@ jobs:
- name: Build OpenDAL doc
working-directory: core
- run: cargo +${{ env.RUST_DOC_TOOLCHAIN }} doc --lib --no-deps --all-features
+ run: |
+ cargo +${{ env.RUST_DOC_TOOLCHAIN }} doc \
+ --workspace --lib --no-deps --all-features
+ cargo +${{ env.RUST_DOC_TOOLCHAIN }} doc \
+ --package opendal-service-opfs --lib --no-deps --all-features \
+ --target wasm32-unknown-unknown
env:
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
diff --git a/core/README.md b/core/README.md
index b4e9bc33e2..f8d0e6a859 100644
--- a/core/README.md
+++ b/core/README.md
@@ -20,8 +20,8 @@ Apache OpenDAL™ is an Open Data Access Layer that enables seamless interaction
- **API reference**: [docs.rs/opendal](https://docs.rs/opendal/) (release) | [dev](https://opendal.apache.org/docs/rust/opendal/)
- **Services & configuration**: [opendal.apache.org/services](https://opendal.apache.org/services)
- **Concepts**: [opendal.apache.org/docs/concepts](https://opendal.apache.org/docs/concepts)
-- [Upgrade Guide](https://docs.rs/opendal/latest/opendal/docs/upgrade/index.html) | [Release Notes](https://docs.rs/opendal/latest/opendal/docs/changelog/index.html) | [RFCs](https://docs.rs/opendal/latest/opendal/docs/rfcs/index.html)
-- [Examples](./examples)
+- [Upgrade Guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/upgrade.md) | [Release Notes](https://github.com/apache/opendal/blob/main/CHANGELOG.md) | [RFCs](https://github.com/apache/opendal/tree/main/core/core/src/docs/rfcs)
+- [Examples](https://github.com/apache/opendal/tree/main/core/examples)
## Installation
@@ -83,8 +83,13 @@ timeout, and concurrency limit are built in:
```rust
use opendal::layers::RetryLayer;
+use opendal::services::Memory;
+use opendal::{Operator, Result};
-let op = op.layer(RetryLayer::new());
+fn build_operator() -> Result<Operator> {
+ let op = Operator::new(Memory::default())?;
+ Ok(op.layer(RetryLayer::new()))
+}
```
See [Going to production](https://opendal.apache.org/docs/core/production) and the
@@ -92,12 +97,12 @@ See [Going to production](https://opendal.apache.org/docs/core/production) and t
## Contributing
-Check out the [CONTRIBUTING](./CONTRIBUTING.md) guide for building, testing, and
+Check out the [CONTRIBUTING](https://github.com/apache/opendal/blob/main/CONTRIBUTING.md) guide for building, testing, and
submitting changes to the core.
## Used by
-Check out the [users](./users.md) list for more details on who is using OpenDAL.
+Check out the [users](https://github.com/apache/opendal/blob/main/core/users.md) list for more details on who is using OpenDAL.
## Branding
@@ -107,6 +112,6 @@ For more details, see the [Apache Product Name Usage Guide](https://www.apache.o
## License and Trademarks
-Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
+Licensed under the Apache License, Version 2.0: <http://www.apache.org/licenses/LICENSE-2.0>
Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.
diff --git a/core/core/Cargo.toml b/core/core/Cargo.toml
index b9abdb8757..ceedefe135 100644
--- a/core/core/Cargo.toml
+++ b/core/core/Cargo.toml
@@ -62,7 +62,6 @@ services-memory = []
[lib]
bench = false
-doctest = false
[dependencies]
# Required dependencies
diff --git a/core/core/README.md b/core/core/README.md
index e72c390217..e36a13e134 100644
--- a/core/core/README.md
+++ b/core/core/README.md
@@ -40,8 +40,8 @@ behavior explicitly:
- A service crate exports a builder that implements `opendal_core::Builder`.
Pass the configured builder to `Operator::new`.
-- A layer crate exports a type that implements `opendal_core::Layer`. Pass the
- configured layer to `Operator::layer`.
+- A layer crate exports a type that implements `opendal_core::raw::Layer`. Pass
+ the configured layer to `Operator::layer`.
- An HTTP transport crate exports an `opendal_core::HttpTransport`
implementation. Wrap it in `HttpTransporter` and place it in the operator's
`OperationContext`.
@@ -54,7 +54,7 @@ cargo add opendal-core opendal-service-s3 opendal-layer-retry
cargo add opendal-http-transport-reqwest
```
-```rust
+```rust,ignore
use opendal_core::HttpTransporter;
use opendal_core::OperationContext;
use opendal_core::Operator;
diff --git a/core/core/src/blocking/delete.rs b/core/core/src/blocking/delete.rs
index e8b65157fd..3d0684aee7 100644
--- a/core/core/src/blocking/delete.rs
+++ b/core/core/src/blocking/delete.rs
@@ -40,7 +40,7 @@ impl Deleter {
///
/// Also see:
///
- /// - [`BlockingDeleter::delete_try_iter`]: delete an fallible iterator of paths.
+ /// - [`Deleter::delete_try_iter`]: delete a fallible iterator of paths.
pub fn delete_iter<I, D>(&mut self, iter: I) -> Result<()>
where
I: IntoIterator<Item = D>,
@@ -53,7 +53,7 @@ impl Deleter {
///
/// Also see:
///
- /// - [`BlockingDeleter::delete_iter`]: delete an infallible iterator of paths.
+ /// - [`Deleter::delete_iter`]: delete an infallible iterator of paths.
pub fn delete_try_iter<I, D>(&mut self, try_iter: I) -> Result<()>
where
I: IntoIterator<Item = Result<D>>,
diff --git a/core/core/src/blocking/list.rs b/core/core/src/blocking/list.rs
index 85bea84abb..18afb46ce1 100644
--- a/core/core/src/blocking/list.rs
+++ b/core/core/src/blocking/list.rs
@@ -23,7 +23,8 @@ use crate::*;
/// BlockingLister is designed to list entries at given path in a blocking
/// manner.
///
-/// Users can construct Lister by [`blocking::Operator::lister`] or [`blocking::Operator::lister_with`].
+/// Users can construct a lister through [`Operator::lister`][crate::blocking::Operator::lister]
+/// or [`Operator::lister_options`][crate::blocking::Operator::lister_options].
///
/// - Lister implements `Iterator<Item = Result<Entry>>`.
/// - Lister will return `None` if there is no more entries or error has been returned.
diff --git a/core/core/src/blocking/operator.rs b/core/core/src/blocking/operator.rs
index 1fe6078585..1fbba15ea4 100644
--- a/core/core/src/blocking/operator.rs
+++ b/core/core/src/blocking/operator.rs
@@ -282,7 +282,8 @@ impl Operator {
/// | stat file with `/` | `abc/def_file/` | Error `NotFound` |
/// | stat not existing path | `xyz` | Error `NotFound` |
///
- /// Refer to [RFC: List Prefix][crate::docs::rfcs::rfc_3243_list_prefix] for more details.
+ /// Refer to [RFC: List Prefix](https://github.com/apache/opendal/blob/main/core/core/src/docs/rfcs/3243_list_prefix.md)
+ /// for more details.
///
/// ## Services that not support `create_dir`
///
@@ -334,7 +335,8 @@ impl Operator {
/// | stat file with `/` | `abc/def_file/` | Error `NotFound` |
/// | stat not existing path | `xyz` | Error `NotFound` |
///
- /// Refer to [RFC: List Prefix][crate::docs::rfcs::rfc_3243_list_prefix] for more details.
+ /// Refer to [RFC: List Prefix](https://github.com/apache/opendal/blob/main/core/core/src/docs/rfcs/3243_list_prefix.md)
+ /// for more details.
///
/// ## Services that not support `create_dir`
///
@@ -711,11 +713,13 @@ impl Operator {
self.handle.block_on(self.op.delete_try_iter(try_iter))
}
- /// Create a [`BlockingDeleter`] to continuously remove content from storage.
+ /// Create a [`blocking::Deleter`] to continuously remove content from
+ /// storage.
///
/// It leverages batch deletion capabilities provided by storage services for efficient removal.
///
- /// Users can have more control over the deletion process by using [`BlockingDeleter`] directly.
+ /// Use [`blocking::Deleter`] directly for more control over the deletion
+ /// process.
pub fn deleter(&self) -> Result<blocking::Deleter> {
blocking::Deleter::create(
self.handle.clone(),
@@ -839,7 +843,8 @@ impl Operator {
/// Create a streaming lister for entries whose paths start with the given prefix `path`.
///
- /// This function creates a new [`BlockingLister`]; dropping it stops listing.
+ /// This function creates a new [`blocking::Lister`]; dropping it stops
+ /// listing.
///
/// # Semantics
///
diff --git a/core/core/src/blocking/read/std_bytes_iterator.rs b/core/core/src/blocking/read/std_bytes_iterator.rs
index 193270a9db..06a5126bf7 100644
--- a/core/core/src/blocking/read/std_bytes_iterator.rs
+++ b/core/core/src/blocking/read/std_bytes_iterator.rs
@@ -22,7 +22,8 @@ use futures::StreamExt;
use crate::*;
-/// StdIterator is the adapter of [`Iterator`] for [`BlockingReader`][crate::BlockingReader].
+/// `StdBytesIterator` adapts a [`crate::blocking::Reader`] into an
+/// [`Iterator`].
///
/// Users can use this adapter in cases where they need to use [`Iterator`] trait.
///
diff --git a/core/core/src/blocking/read/std_reader.rs b/core/core/src/blocking/read/std_reader.rs
index 9cdea17e3a..3d72f9c51b 100644
--- a/core/core/src/blocking/read/std_reader.rs
+++ b/core/core/src/blocking/read/std_reader.rs
@@ -27,7 +27,8 @@ use futures::AsyncSeekExt;
use crate::*;
-/// StdReader is the adapter of [`Read`], [`Seek`] and [`BufRead`] for [`BlockingReader`][crate::BlockingReader].
+/// `StdReader` adapts a [`crate::blocking::Reader`] to [`Read`], [`Seek`], and
+/// [`BufRead`].
///
/// Users can use this adapter in cases where they need to use [`Read`] or [`BufRead`] trait.
///
diff --git a/core/core/src/blocking/write/std_writer.rs b/core/core/src/blocking/write/std_writer.rs
index 41e5c3507d..51f9be75fd 100644
--- a/core/core/src/blocking/write/std_writer.rs
+++ b/core/core/src/blocking/write/std_writer.rs
@@ -21,7 +21,7 @@ use futures::AsyncWriteExt;
use crate::*;
-/// StdWriter is the adapter of [`std::io::Write`] for [`BlockingWriter`].
+/// `StdWriter` adapts a [`crate::blocking::Writer`] to [`std::io::Write`].
///
/// Users can use this adapter in cases where they need to use [`std::io::Write`] related trait.
///
diff --git a/core/core/src/layers/mod.rs b/core/core/src/layers/mod.rs
index 8c93147902..fa446371f2 100644
--- a/core/core/src/layers/mod.rs
+++ b/core/core/src/layers/mod.rs
@@ -15,7 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-//! `Layer` is the mechanism to intercept operations.
+//! Core layers used by `opendal-core`.
+//!
+//! A [`crate::raw::Layer`] wraps an access implementation to intercept or adjust
+//! operations. Optional reusable layers such as retry, timeout, logging, and
+//! metrics live in `opendal-layer-*` crates and are re-exported by the
+//! `opendal` facade behind `layers-*` Cargo features.
mod error_context;
pub(crate) use error_context::ErrorContextLayer;
diff --git a/core/core/src/lib.rs b/core/core/src/lib.rs
index ac75df60fe..688f4d799e 100644
--- a/core/core/src/lib.rs
+++ b/core/core/src/lib.rs
@@ -18,142 +18,9 @@
#![doc(
html_logo_url = "https://raw.githubusercontent.com/apache/opendal/main/website/static/img/logo.svg"
)]
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Apache OpenDAL™ is an Open Data Access Layer that enables seamless interaction with diverse storage services.
-//!
-//! OpenDAL's development is guided by its vision of **One Layer, All Storage** and its core principles: **Open Community**, **Solid Foundation**, **Fast Access**, **Object Storage First**, and **Extensible Architecture**. Read the explained vision at [OpenDAL Vision](https://opendal.apache.org/vision).
-//!
-//! # Quick Start
-//!
-//! OpenDAL's API entry points are [`Operator`] and [`blocking::Operator`]. All
-//! public APIs are accessible through the operator. To utilize OpenDAL, you
-//! need to:
-//!
-//! - [Init a service](#init-a-service)
-//! - [Compose layers](#compose-layers)
-//! - [Use operator](#use-operator)
-//!
-//! ## Init a service
-//!
-//! The first step is to pick a service and init it with a builder. All supported
-//! services could be found at [`services`].
-//!
-//! Let's take [`services::Memory`] as an example:
-//!
-//! ```no_run
-//! use opendal_core::services;
-//! use opendal_core::Operator;
-//! use opendal_core::Result;
-//!
-//! fn main() -> Result<()> {
-//! // Pick a builder and configure it.
-//! let builder = services::Memory::default();
-//!
-//! // Init an operator
-//! let op = Operator::new(builder)?;
-//! Ok(())
-//! }
-//! ```
-//!
-//! ## Compose layers
-//!
-//! The next setup is to compose layers. Layers are modules that provide extra
-//! features for every operation. All builtin layers could be found at [`layers`].
-//!
-//! Let's use [`layers::CapabilityOverrideLayer`] and a custom [`HttpTransporter`] as an example.
-//!
-//! ```no_run
-//! use opendal_core::layers::CapabilityOverrideLayer;
-//! use opendal_core::HttpTransporter;
-//! use opendal_core::OperationContext;
-//! use opendal_core::services;
-//! use opendal_core::Operator;
-//! use opendal_core::Result;
-//!
-//! #[tokio::main]
-//! async fn main() -> Result<()> {
-//! // Pick a builder and configure it.
-//! let builder = services::Memory::default();
-//!
-//! // Init an operator
-//! let transport = HttpTransporter::default();
-//! let op = Operator::new(builder)?
-//! // Replace the base HTTP transport.
-//! .with_context(OperationContext::new().with_http_transport(transport))
-//! .layer(CapabilityOverrideLayer::new(|cap| cap));
-//!
-//! Ok(())
-//! }
-//! ```
-//!
-//! ## Use operator
-//!
-//! The final step is to use the operator. OpenDAL supports both async [`Operator`]
-//! and blocking [`blocking::Operator`]. Please pick the one that fits your use case.
-//!
-//! Every Operator API follows a consistent pattern. For example, consider the `read` operation:
-//!
-//! - [`Operator::read`]: Executes a read operation.
-//! - [`Operator::read_with`]: Executes a read operation with additional options using the builder pattern.
-//! - [`Operator::read_options`]: Executes a read operation with extra options provided via a [`options::ReadOptions`] struct.
-//! - [`Operator::reader`]: Creates a reader for streaming data, allowing for flexible access.
-//! - [`Operator::reader_with`]: Creates a reader with advanced options using the builder pattern.
-//! - [`Operator::reader_options`]: Creates a reader with extra options provided via a [`options::ReadOptions`] struct.
-//!
-//! The [`Reader`] created by [`Operator`] supports custom read control methods and can be converted
-//! into [`futures::AsyncRead`] or [`futures::Stream`] for broader ecosystem compatibility.
-//!
-//! ```no_run
-//! use opendal_core::options;
-//! use opendal_core::HttpTransporter;
-//! use opendal_core::OperationContext;
-//! use opendal_core::services;
-//! use opendal_core::Operator;
-//! use opendal_core::Result;
-//!
-//! #[tokio::main]
-//! async fn main() -> Result<()> {
-//! // Pick a builder and configure it.
-//! let builder = services::Memory::default();
-//!
-//! // Init an operator
-//! let transport = HttpTransporter::default();
-//! let op = Operator::new(builder)?
-//! // Replace the base HTTP transport.
-//! .with_context(OperationContext::new().with_http_transport(transport));
-//!
-//! // Fetch this file's metadata
-//! let meta = op.stat("hello.txt").await?;
-//! let length = meta.content_length();
-//!
-//! // Read data from `hello.txt` with options.
-//! let bs = op
-//! .read_with("hello.txt")
-//! .range(0..8 * 1024 * 1024)
-//! .chunk(1024 * 1024)
-//! .concurrent(4)
-//! .await?;
-//!
-//! // The same to:
-//! let bs = op
-//! .read_options("hello.txt", options::ReadOptions {
-//! range: (0..8 * 1024 * 1024).into(),
-//! chunk: Some(1024 * 1024),
-//! concurrent: 4,
-//! ..Default::default()
-//! })
-//! .await?;
-//!
-//! Ok(())
-//! }
-//! ```
-//!
-//! # Useful Links
-//!
-//! - [Concept][crate::docs::concepts]
-//! - [Internals][crate::docs::internals]
-//! - [Performance Guide][crate::docs::performance]
-
+#![cfg_attr(docsrs, doc(auto_cfg))]
// Make sure all our public APIs have docs.
#![deny(missing_docs)]
@@ -164,8 +31,6 @@ pub use types::*;
// Public modules, they will be accessed like `opendal::layers::Xxxx`
#[cfg(feature = "blocking")]
pub mod blocking;
-#[cfg(docsrs)]
-pub mod docs;
pub mod layers;
pub mod raw;
pub mod services;
diff --git a/core/core/src/raw/ops.rs b/core/core/src/raw/ops.rs
index 4dbd6fc4ed..eee51bed2f 100644
--- a/core/core/src/raw/ops.rs
+++ b/core/core/src/raw/ops.rs
@@ -1017,7 +1017,7 @@ impl OpRename {
///
/// ## Service Implementation
///
- /// Check [`Capability::rename_with_if_not_exists`] before setting this to
+ /// Check [`crate::Capability::rename_with_if_not_exists`] before setting this to
/// `true`. A service might return `ErrorKind::Unsupported` if it cannot
/// enforce the condition.
pub fn with_if_not_exists(mut self, if_not_exists: bool) -> Self {
diff --git a/core/core/src/services/memory/mod.rs b/core/core/src/services/memory/mod.rs
index 9937e14cb5..e7b7b86eb9 100644
--- a/core/core/src/services/memory/mod.rs
+++ b/core/core/src/services/memory/mod.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for memory service.
+/// URI scheme used for memory service registration and URI construction.
pub const MEMORY_SCHEME: &str = "memory";
mod backend;
@@ -28,7 +28,11 @@ mod writer;
pub use backend::MemoryBuilder as Memory;
pub use config::MemoryConfig;
-/// Register this service into the given registry.
+/// Register the memory URI scheme with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`crate::Operator::from_uri`] and [`crate::Operator::via_iter`]. Direct
+/// construction through [`crate::Operator::new`] does not require registration.
pub fn register_memory_service(registry: &crate::OperatorRegistry) {
registry.register::<Memory>(MEMORY_SCHEME);
}
diff --git a/core/core/src/services/mod.rs b/core/core/src/services/mod.rs
index 64de2dc29c..d90ebc04c9 100644
--- a/core/core/src/services/mod.rs
+++ b/core/core/src/services/mod.rs
@@ -15,9 +15,15 @@
// specific language governing permissions and limitations
// under the License.
-//! Services will provide builders to build underlying backends.
+//! Built-in service support.
//!
-//! More ongoing services support is tracked at [opendal#5](https://github.com/apache/opendal/issues/5). Please feel free to submit issues if there are services not covered.
+//! [`Memory`] is the only storage service implemented by `opendal-core`
+//! directly. Other services live in `opendal-service-*` crates and are
+//! re-exported by the `opendal` facade behind `services-*` Cargo features.
+//!
+//! Pass a builder directly to [`crate::Operator::new`]. Service registration is
+//! only required for scheme-driven construction through
+//! [`crate::Operator::from_uri`] or [`crate::Operator::via_iter`].
mod memory;
pub use self::memory::*;
diff --git a/core/core/src/types/entry.rs b/core/core/src/types/entry.rs
index d663a8b024..35812aad53 100644
--- a/core/core/src/types/entry.rs
+++ b/core/core/src/types/entry.rs
@@ -20,7 +20,7 @@ use crate::*;
/// `Entry` represents an entry's path and metadata.
///
-/// [`Lister`] and [`BlockingLister`] return `Entry` values.
+/// [`Lister`] and [`crate::blocking::Lister`] return `Entry` values.
#[derive(Clone, Debug)]
pub struct Entry {
/// Path of this entry.
diff --git a/core/core/src/types/operator/operator.rs b/core/core/src/types/operator/operator.rs
index 0e557083d5..c27efafb10 100644
--- a/core/core/src/types/operator/operator.rs
+++ b/core/core/src/types/operator/operator.rs
@@ -818,7 +818,8 @@ impl Operator {
///
/// # Notes
///
- /// Visit [`performance::concurrent_write`][crate::docs::performance::concurrent_write] for more details on concurrent writes.
+ /// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
+ /// for more details.
///
/// ## Extra Options
///
@@ -859,7 +860,8 @@ impl Operator {
///
/// # Notes
///
- /// Visit [`performance::concurrent_write`][crate::docs::performance::concurrent_write] for more details on concurrent writes.
+ /// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
+ /// for more details.
///
/// ## Streaming Write
///
@@ -914,7 +916,8 @@ impl Operator {
///
/// # Notes
///
- /// Visit [`performance::concurrent_write`][crate::docs::performance::concurrent_write] for more details on concurrent writes.
+ /// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
+ /// for more details.
///
/// ## Streaming Write
///
@@ -1044,7 +1047,8 @@ impl Operator {
/// [Capability](crate::types::Capability). However, you can override this by explicitly
/// setting the `chunk` parameter.
///
- /// Visit [`performance::concurrent_write`][crate::docs::performance::concurrent_write] for more details on concurrent writes.
+ /// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
+ /// for more details.
///
/// # Examples
///
@@ -1098,7 +1102,8 @@ impl Operator {
/// [Capability](crate::types::Capability). However, you can override this by explicitly
/// setting the `chunk` parameter.
///
- /// Visit [`performance::concurrent_write`][crate::docs::performance::concurrent_write] for more details on concurrent writes.
+ /// Read the [concurrent write guide](https://github.com/apache/opendal/blob/main/core/core/src/docs/performance/concurrent_write.md)
+ /// for more details.
///
/// # Examples
///
diff --git a/core/core/src/types/options.rs b/core/core/src/types/options.rs
index 6972225fd6..4d16e777ed 100644
--- a/core/core/src/types/options.rs
+++ b/core/core/src/types/options.rs
@@ -74,21 +74,21 @@ pub struct ReadOptions {
///
/// This option can be used to retrieve the data of a specified version of the given path.
///
- /// If the version doesn't exist, an error with kind [`ErrorKind::NotFound`] will be returned.
+ /// If the version doesn't exist, an error with kind [`crate::ErrorKind::NotFound`] will be returned.
pub version: Option<String>,
/// Set `if_match` for this operation.
///
/// This option can be used to check if the file's `ETag` matches the given `ETag`.
///
- /// If file exists and it's etag doesn't match, an error with kind [`ErrorKind::ConditionNotMatch`]
+ /// If file exists and it's etag doesn't match, an error with kind [`crate::ErrorKind::ConditionNotMatch`]
/// will be returned.
pub if_match: Option<String>,
/// Set `if_none_match` for this operation.
///
/// This option can be used to check if the file's `ETag` doesn't match the given `ETag`.
///
- /// If file exists and it's etag match, an error with kind [`ErrorKind::ConditionNotMatch`]
+ /// If file exists and it's etag match, an error with kind [`crate::ErrorKind::ConditionNotMatch`]
/// will be returned.
pub if_none_match: Option<String>,
/// Set `if_modified_since` for this operation.
@@ -96,14 +96,14 @@ pub struct ReadOptions {
/// This option can be used to check if the file has been modified since the given timestamp.
///
/// If file exists and it hasn't been modified since the specified time, an error with kind
- /// [`ErrorKind::ConditionNotMatch`] will be returned.
+ /// [`crate::ErrorKind::ConditionNotMatch`] will be returned.
pub if_modified_since: Option<Timestamp>,
/// Set `if_unmodified_since` for this operation.
///
/// This feature can be used to check if the file hasn't been modified since the given timestamp.
///
/// If file exists and it has been modified since the specified time, an error with kind
- /// [`ErrorKind::ConditionNotMatch`] will be returned.
+ /// [`crate::ErrorKind::ConditionNotMatch`] will be returned.
pub if_unmodified_since: Option<Timestamp>,
/// Known content length of the object.
@@ -122,15 +122,17 @@ pub struct ReadOptions {
/// By setting `concurrent`, opendal will fetch chunks concurrently with
/// the give chunk size.
///
- /// Refer to [`crate::docs::performance`] for more details.
+ /// Refer to the [performance guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
+ /// for more details.
pub concurrent: usize,
/// Set `chunk` for the operation.
///
/// OpenDAL will use services' preferred chunk size by default. Users can set chunk based on their own needs.
///
- /// Refer to [`crate::docs::performance`] for more details.
+ /// Refer to the [performance guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
+ /// for more details.
pub chunk: Option<usize>,
- /// Controls the optimization strategy for range reads in [`Reader::fetch`].
+ /// Controls the optimization strategy for range reads in [`crate::Reader::fetch`].
///
/// When performing range reads, if the gap between two requested ranges is smaller than
/// the configured `gap` size, OpenDAL will merge these ranges into a single read request
@@ -141,7 +143,8 @@ pub struct ReadOptions {
/// that are close to each other, as it reduces the overhead of multiple network requests
/// at the cost of transferring some additional data.
///
- /// Refer to [`crate::docs::performance`] for more details.
+ /// Refer to the [performance guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
+ /// for more details.
pub gap: Option<usize>,
/// Specify the content-type header that should be sent back by the operation.
@@ -165,21 +168,21 @@ pub struct ReaderOptions {
///
/// This option can be used to retrieve the data of a specified version of the given path.
///
- /// If the version doesn't exist, an error with kind [`ErrorKind::NotFound`] will be returned.
+ /// If the version doesn't exist, an error with kind [`crate::ErrorKind::NotFound`] will be returned.
pub version: Option<String>,
/// Set `if_match` for this operation.
///
/// This option can be used to check if the file's `ETag` matches the given `ETag`.
///
- /// If file exists and it's etag doesn't match, an error with kind [`ErrorKind::ConditionNotMatch`]
+ /// If file exists and it's etag doesn't match, an error with kind [`crate::ErrorKind::ConditionNotMatch`]
/// will be returned.
pub if_match: Option<String>,
/// Set `if_none_match` for this operation.
///
/// This option can be used to check if the file's `ETag` doesn't match the given `ETag`.
///
- /// If file exists and it's etag match, an error with kind [`ErrorKind::ConditionNotMatch`]
+ /// If file exists and it's etag match, an error with kind [`crate::ErrorKind::ConditionNotMatch`]
/// will be returned.
pub if_none_match: Option<String>,
/// Set `if_modified_since` for this operation.
@@ -187,14 +190,14 @@ pub struct ReaderOptions {
/// This option can be used to check if the file has been modified since the given timestamp.
///
/// If file exists and it hasn't been modified since the specified time, an error with kind
- /// [`ErrorKind::ConditionNotMatch`] will be returned.
+ /// [`crate::ErrorKind::ConditionNotMatch`] will be returned.
pub if_modified_since: Option<Timestamp>,
/// Set `if_unmodified_since` for this operation.
///
/// This feature can be used to check if the file hasn't been modified since the given timestamp.
///
/// If file exists and it has been modified since the specified time, an error with kind
- /// [`ErrorKind::ConditionNotMatch`] will be returned.
+ /// [`crate::ErrorKind::ConditionNotMatch`] will be returned.
pub if_unmodified_since: Option<Timestamp>,
/// Known content length of the object.
@@ -213,15 +216,17 @@ pub struct ReaderOptions {
/// By setting `concurrent`, opendal will fetch chunks concurrently with
/// the give chunk size.
///
- /// Refer to [`crate::docs::performance`] for more details.
+ /// Refer to the [performance guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
+ /// for more details.
pub concurrent: usize,
/// Set `chunk` for the operation.
///
/// OpenDAL will use services' preferred chunk size by default. Users can set chunk based on their own needs.
///
- /// Refer to [`crate::docs::performance`] for more details.
+ /// Refer to the [performance guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
+ /// for more details.
pub chunk: Option<usize>,
- /// Controls the optimization strategy for range reads in [`Reader::fetch`].
+ /// Controls the optimization strategy for range reads in [`crate::Reader::fetch`].
///
/// When performing range reads, if the gap between two requested ranges is smaller than
/// the configured `gap` size, OpenDAL will merge these ranges into a single read request
@@ -232,7 +237,8 @@ pub struct ReaderOptions {
/// that are close to each other, as it reduces the overhead of multiple network requests
/// at the cost of transferring some additional data.
///
- /// Refer to [`crate::docs::performance`] for more details.
+ /// Refer to the [performance guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
+ /// for more details.
pub gap: Option<usize>,
/// Controls the number of prefetched bytes ranges that can be buffered in memory
/// during concurrent reading.
@@ -257,21 +263,21 @@ pub struct StatOptions {
///
/// This options can be used to retrieve the data of a specified version of the given path.
///
- /// If the version doesn't exist, an error with kind [`ErrorKind::NotFound`] will be returned.
+ /// If the version doesn't exist, an error with kind [`crate::ErrorKind::NotFound`] will be returned.
pub version: Option<String>,
/// Set `if_match` for this operation.
///
/// This option can be used to check if the file's `ETag` matches the given `ETag`.
///
- /// If file exists and it's etag doesn't match, an error with kind [`ErrorKind::ConditionNotMatch`]
+ /// If file exists and it's etag doesn't match, an error with kind [`crate::ErrorKind::ConditionNotMatch`]
/// will be returned.
pub if_match: Option<String>,
/// Set `if_none_match` for this operation.
///
/// This option can be used to check if the file's `ETag` doesn't match the given `ETag`.
///
- /// If file exists and it's etag match, an error with kind [`ErrorKind::ConditionNotMatch`]
+ /// If file exists and it's etag match, an error with kind [`crate::ErrorKind::ConditionNotMatch`]
/// will be returned.
pub if_none_match: Option<String>,
/// Set `if_modified_since` for this operation.
@@ -279,14 +285,14 @@ pub struct StatOptions {
/// This option can be used to check if the file has been modified since the given timestamp.
///
/// If file exists and it hasn't been modified since the specified time, an error with kind
- /// [`ErrorKind::ConditionNotMatch`] will be returned.
+ /// [`crate::ErrorKind::ConditionNotMatch`] will be returned.
pub if_modified_since: Option<Timestamp>,
/// Set `if_unmodified_since` for this operation.
///
/// This feature can be used to check if the file hasn't been modified since the given timestamp.
///
/// If file exists and it has been modified since the specified time, an error with kind
- /// [`ErrorKind::ConditionNotMatch`] will be returned.
+ /// [`crate::ErrorKind::ConditionNotMatch`] will be returned.
pub if_unmodified_since: Option<Timestamp>,
/// Specify the content-type header that should be sent back by the operation.
@@ -310,7 +316,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_can_append`] before using this option.
+ /// Check [`crate::Capability::write_can_append`] before using this option.
///
/// ### Behavior
///
@@ -327,7 +333,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_cache_control`] before using this feature.
+ /// Check [`crate::Capability::write_with_cache_control`] before using this feature.
///
/// ### Behavior
///
@@ -353,7 +359,7 @@ pub struct WriteOptions {
///
/// ## Capability
///
- /// Check [`Capability::write_with_content_type`] before using this feature.
+ /// Check [`crate::Capability::write_with_content_type`] before using this feature.
///
/// ### Behavior
///
@@ -367,7 +373,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_content_disposition`] before using this feature.
+ /// Check [`crate::Capability::write_with_content_disposition`] before using this feature.
///
/// ### Behavior
///
@@ -385,7 +391,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_content_encoding`] before using this feature.
+ /// Check [`crate::Capability::write_with_content_encoding`] before using this feature.
///
/// ### Behavior
///
@@ -404,7 +410,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_user_metadata`] before using this feature.
+ /// Check [`crate::Capability::write_with_user_metadata`] before using this feature.
///
/// ### Behavior
///
@@ -426,7 +432,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_if_match`] before using this feature.
+ /// Check [`crate::Capability::write_with_if_match`] before using this feature.
///
/// ### Behavior
///
@@ -447,7 +453,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_if_none_match`] before using this feature.
+ /// Check [`crate::Capability::write_with_if_none_match`] before using this feature.
///
/// ### Behavior
///
@@ -465,7 +471,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_with_if_not_exists`] before using this feature.
+ /// Check [`crate::Capability::write_with_if_not_exists`] before using this feature.
///
/// ### Behavior
///
@@ -506,7 +512,7 @@ pub struct WriteOptions {
///
/// ### Capability
///
- /// Check [`Capability::write_multi_min_size`] and [`Capability::write_multi_max_size`] for size limits.
+ /// Check [`crate::Capability::write_multi_min_size`] and [`crate::Capability::write_multi_max_size`] for size limits.
///
/// ### Behavior
///
@@ -537,7 +543,7 @@ pub struct CopyOptions {
///
/// ### Capability
///
- /// Check [`Capability::copy_with_if_not_exists`] before using this feature.
+ /// Check [`crate::Capability::copy_with_if_not_exists`] before using this feature.
///
/// ### Behavior
///
@@ -554,7 +560,7 @@ pub struct CopyOptions {
///
/// ### Capability
///
- /// Check [`Capability::copy_with_if_match`] before using this feature.
+ /// Check [`crate::Capability::copy_with_if_match`] before using this feature.
///
/// ### Behavior
///
@@ -566,7 +572,7 @@ pub struct CopyOptions {
///
/// ### Capability
///
- /// Check [`Capability::copy_with_source_version`] before using this feature.
+ /// Check [`crate::Capability::copy_with_source_version`] before using this feature.
///
/// ### Behavior
///
@@ -592,9 +598,9 @@ pub struct CopyOptions {
///
/// ### Capability
///
- /// Check [`Capability::copy_can_multi`],
- /// [`Capability::copy_multi_min_size`] and
- /// [`Capability::copy_multi_max_size`] before using this feature.
+ /// Check [`crate::Capability::copy_can_multi`],
+ /// [`crate::Capability::copy_multi_min_size`] and
+ /// [`crate::Capability::copy_multi_max_size`] before using this feature.
///
/// This is a best-effort execution option. Services that support
/// server-side segmented copy can use it as the target size for each copy
@@ -609,13 +615,13 @@ pub struct RenameOptions {
///
/// ### Capability
///
- /// Check [`Capability::rename_with_if_not_exists`] before using this feature.
+ /// Check [`crate::Capability::rename_with_if_not_exists`] before using this feature.
///
/// ### Behavior
///
/// - If the target does not exist, the rename operation succeeds.
- /// - If the target exists, the operation returns [`ErrorKind::ConditionNotMatch`].
+ /// - If the target exists, the operation returns [`crate::ErrorKind::ConditionNotMatch`].
/// - If the service does not support this condition, the operation returns
- /// [`ErrorKind::Unsupported`].
+ /// [`crate::ErrorKind::Unsupported`].
pub if_not_exists: bool,
}
diff --git a/core/core/src/types/read/reader.rs b/core/core/src/types/read/reader.rs
index 9fcfa691a7..274fae936e 100644
--- a/core/core/src/types/read/reader.rs
+++ b/core/core/src/types/read/reader.rs
@@ -331,7 +331,8 @@ impl Reader {
/// BufferStream is a zero-cost abstraction. It doesn't involve extra copy of data.
/// It will return underlying [`Buffer`] directly.
///
- /// The [`Buffer`] this stream yields can be seen as an iterator of [`Bytes`].
+ /// The [`Buffer`] this stream yields can be seen as an iterator of
+ /// [`bytes::Bytes`].
///
/// # Inputs
///
diff --git a/core/core/src/types/write/writer.rs b/core/core/src/types/write/writer.rs
index 80dbd3153c..36da8aa508 100644
--- a/core/core/src/types/write/writer.rs
+++ b/core/core/src/types/write/writer.rs
@@ -202,7 +202,8 @@ impl Writer {
self.inner.close().await
}
- /// Convert writer into [`BufferSink`] which implements [`Sink<Buffer>`].
+ /// Convert this writer into a [`BufferSink`] that implements
+ /// [`Sink<Buffer>`][futures::Sink].
///
/// # Notes
///
diff --git a/core/http-transports/reqwest/README.md b/core/http-transports/reqwest/README.md
index 939555e77b..eadf7ff704 100644
--- a/core/http-transports/reqwest/README.md
+++ b/core/http-transports/reqwest/README.md
@@ -117,7 +117,7 @@ reqwest = { version = "0.13.4", default-features = false, features = [
] }
```
-```rust
+```rust,ignore
use std::time::Duration;
use opendal::HttpTransporter;
@@ -148,7 +148,7 @@ reqwest = { version = "0.13.4", default-features = false, features = [
] }
```
-```rust
+```rust,ignore
use opendal::HttpTransporter;
use opendal::ReqwestTransport;
@@ -183,7 +183,7 @@ rustls = { version = "0.23", default-features = false, features = ["std"] }
webpki-roots = "1"
```
-```rust
+```rust,ignore
use opendal::HttpTransporter;
use opendal::ReqwestTransport;
@@ -219,6 +219,6 @@ for the target-specific limitations.
## License and Trademarks
-Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
+Licensed under the Apache License, Version 2.0: <http://www.apache.org/licenses/LICENSE-2.0>
Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.
diff --git a/core/http-transports/reqwest/src/lib.rs b/core/http-transports/reqwest/src/lib.rs
index dcc8d878a8..1d211ca04f 100644
--- a/core/http-transports/reqwest/src/lib.rs
+++ b/core/http-transports/reqwest/src/lib.rs
@@ -15,55 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Reqwest based HTTP transport for Apache OpenDAL.
-//!
-//! # TLS backends
-//!
-//! Enable one of the following Cargo features to compile reqwest TLS support.
-//! The `default` feature enables `rustls`.
-//!
-//! - **`native-tls`** — Platform TLS links against the OS TLS library:
-//! - Windows: SChannel
-//! - macOS: Secure Transport
-//! - Linux: OpenSSL, requires system development packages
-//!
-//! - **`rustls`** — [Rustls](https://crates.io/crates/rustls) configured by
-//! reqwest with its default crypto provider and platform certificate
-//! verification. Pure-Rust TLS stack, no system TLS dependency.
-//!
-//! - **`rustls-no-provider`** — Rustls without a built-in crypto provider.
-//! You must install a [`rustls::crypto::CryptoProvider`] before building a
-//! client. Use this when you want to bring your own provider
-//! (e.g., a FIPS-certified module).
-//!
-//! In application or language binding builds, prefer selecting a single backend
-//! feature. In workspace or `--all-features` builds, Cargo may enable multiple
-//! backend features via feature unification; build a [`reqwest::Client`] with
-//! reqwest's TLS configuration methods and pass it to [`ReqwestTransport::new`]
-//! to force the backend you want.
-//!
-//! On wasm targets, reqwest uses the Fetch API instead of hyper. TLS is provided
-//! by the host environment, so native TLS backend features do not select a TLS
-//! stack there.
-//!
-//! # Custom reqwest client
-//!
-//! ```
-//! use std::time::Duration;
-//!
-//! use opendal_core::HttpTransporter;
-//! use opendal_http_transport_reqwest::ReqwestTransport;
-//!
-//! # fn build() -> Result<(), Box<dyn std::error::Error>> {
-//! let client = reqwest::Client::builder()
-//! .tls_backend_rustls()
-//! .connect_timeout(Duration::from_secs(10))
-//! .build()?;
-//! let transport = ReqwestTransport::new(client);
-//! let _transport = HttpTransporter::new(transport);
-//! # Ok(())
-//! # }
-//! ```
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
use std::fmt::{Debug, Formatter};
use std::future;
diff --git a/core/layers/async-backtrace/src/lib.rs b/core/layers/async-backtrace/src/lib.rs
index 7a2fe2e0c4..7e6e6c7f38 100644
--- a/core/layers/async-backtrace/src/lib.rs
+++ b/core/layers/async-backtrace/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Async backtrace layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::sync::Arc;
use opendal_core::raw::*;
diff --git a/core/layers/await-tree/src/lib.rs b/core/layers/await-tree/src/lib.rs
index 2ee1b84a82..8f2fc6e5d0 100644
--- a/core/layers/await-tree/src/lib.rs
+++ b/core/layers/await-tree/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Await tree layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use await_tree::InstrumentAwait;
use std::sync::Arc;
diff --git a/core/layers/capability-check/src/lib.rs b/core/layers/capability-check/src/lib.rs
index 468b428a5b..784051dc9e 100644
--- a/core/layers/capability-check/src/lib.rs
+++ b/core/layers/capability-check/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Capability check layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::sync::Arc;
use opendal_core::raw::*;
diff --git a/core/layers/chaos/src/lib.rs b/core/layers/chaos/src/lib.rs
index 15a74c79d1..0e9ca5201d 100644
--- a/core/layers/chaos/src/lib.rs
+++ b/core/layers/chaos/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Chaos layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::sync::Arc;
use std::sync::Mutex;
diff --git a/core/layers/concurrent-limit/src/lib.rs b/core/layers/concurrent-limit/src/lib.rs
index bba204abd1..c0efd5a3de 100644
--- a/core/layers/concurrent-limit/src/lib.rs
+++ b/core/layers/concurrent-limit/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Concurrent request limit layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
diff --git a/core/layers/dtrace/src/lib.rs b/core/layers/dtrace/src/lib.rs
index 285b401b73..97def18802 100644
--- a/core/layers/dtrace/src/lib.rs
+++ b/core/layers/dtrace/src/lib.rs
@@ -15,12 +15,11 @@
// specific language governing permissions and limitations
// under the License.
-//! Dtrace layer implementation for Apache OpenDAL.
-
#![cfg(target_os = "linux")]
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::ffi::CString;
use std::sync::Arc;
diff --git a/core/layers/fastmetrics/src/lib.rs b/core/layers/fastmetrics/src/lib.rs
index 186f0d5c83..d678fd73cf 100644
--- a/core/layers/fastmetrics/src/lib.rs
+++ b/core/layers/fastmetrics/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Metrics layer (using the [fastmetrics](https://docs.rs/fastmetrics/) crate) implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use fastmetrics::encoder::EncodeLabelSet;
use fastmetrics::encoder::LabelSetEncoder;
use fastmetrics::metrics::counter::Counter;
diff --git a/core/layers/fastrace/src/lib.rs b/core/layers/fastrace/src/lib.rs
index 6c92d2c803..eea5a8dea4 100644
--- a/core/layers/fastrace/src/lib.rs
+++ b/core/layers/fastrace/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Fastrace layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::future::Future;
use std::sync::Arc;
diff --git a/core/layers/foyer/src/deleter.rs b/core/layers/foyer/src/deleter.rs
index f3c3aac30b..945c7766ad 100644
--- a/core/layers/foyer/src/deleter.rs
+++ b/core/layers/foyer/src/deleter.rs
@@ -24,6 +24,7 @@ use opendal_core::raw::oio;
use crate::FoyerKey;
use crate::Inner;
+#[doc(hidden)]
pub struct Deleter<D> {
pub(crate) deleter: D,
pub(crate) keys: Vec<FoyerKey>,
diff --git a/core/layers/foyer/src/lib.rs b/core/layers/foyer/src/lib.rs
index c960c9472d..db63b051bb 100644
--- a/core/layers/foyer/src/lib.rs
+++ b/core/layers/foyer/src/lib.rs
@@ -15,6 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
mod deleter;
mod error;
mod full;
@@ -45,7 +49,9 @@ pub use writer::Writer;
/// We do NOT interpret `None` as "latest" and we do not promote it to any other version.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FoyerKey {
+ /// Object path used as the cache key.
pub path: String,
+ /// Object version, when the read targets a specific version.
pub version: Option<String>,
}
@@ -101,9 +107,12 @@ fn read_string(reader: &mut impl std::io::Read) -> FoyerResult<String> {
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e).into())
}
-/// [`FoyerValue`] is a wrapper around `Buffer` that implements the `Code` trait.
+/// [`FoyerValue`] stores buffered object data in Foyer.
#[derive(Debug)]
-pub struct FoyerValue(pub Buffer);
+pub struct FoyerValue(
+ /// Buffered object data.
+ pub Buffer,
+);
impl Deref for FoyerValue {
type Target = Buffer;
@@ -192,9 +201,11 @@ impl FoyerLayer {
}
}
- /// Sets the size limit for caching.
+ /// Set the object-size range eligible for caching.
///
- /// It is recommended to set a size limit to avoid caching large files that may not be suitable for caching.
+ /// The layer reads through or writes through objects outside this range
+ /// without retaining them in Foyer. The default range accepts every
+ /// representable object size below `usize::MAX`.
pub fn with_size_limit<R: RangeBounds<usize>>(mut self, size_limit: R) -> Self {
let start = match size_limit.start_bound() {
Bound::Included(v) => *v,
@@ -237,6 +248,7 @@ pub(crate) struct Inner {
}
#[derive(Debug)]
+#[doc(hidden)]
pub struct FoyerService {
inner: Servicer,
cache: HybridCache<FoyerKey, FoyerValue>,
diff --git a/core/layers/foyer/src/writer.rs b/core/layers/foyer/src/writer.rs
index 20dd409429..f1f44fafa0 100644
--- a/core/layers/foyer/src/writer.rs
+++ b/core/layers/foyer/src/writer.rs
@@ -26,6 +26,7 @@ use crate::FoyerKey;
use crate::FoyerValue;
use crate::Inner;
+#[doc(hidden)]
pub struct Writer<W> {
pub(crate) w: W,
pub(crate) buf: oio::QueueBuf,
diff --git a/core/layers/hotpath/src/lib.rs b/core/layers/hotpath/src/lib.rs
index bfe415d60e..a7cfb6c802 100644
--- a/core/layers/hotpath/src/lib.rs
+++ b/core/layers/hotpath/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Hotpath layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::pin::Pin;
use std::sync::Arc;
use std::task::Context;
diff --git a/core/layers/immutable-index/src/lib.rs b/core/layers/immutable-index/src/lib.rs
index 760389d4f2..070262a8b1 100644
--- a/core/layers/immutable-index/src/lib.rs
+++ b/core/layers/immutable-index/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Immutable index layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::collections::HashSet;
use std::sync::Arc;
use std::vec::IntoIter;
diff --git a/core/layers/logging/src/lib.rs b/core/layers/logging/src/lib.rs
index cfa1f684ff..baa43d3b2f 100644
--- a/core/layers/logging/src/lib.rs
+++ b/core/layers/logging/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Logging layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::fmt::Debug;
use std::fmt::Display;
use std::sync::Arc;
diff --git a/core/layers/metrics/src/lib.rs b/core/layers/metrics/src/lib.rs
index 4853f9dbd2..fef21bf66d 100644
--- a/core/layers/metrics/src/lib.rs
+++ b/core/layers/metrics/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Metrics layer (using the [metrics](https://docs.rs/metrics/) crate) implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use metrics::Label;
use metrics::counter;
use metrics::gauge;
diff --git a/core/layers/mime-guess/src/lib.rs b/core/layers/mime-guess/src/lib.rs
index 5b902375a2..029ea2598b 100644
--- a/core/layers/mime-guess/src/lib.rs
+++ b/core/layers/mime-guess/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! MIME guess layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::sync::Arc;
use opendal_core::raw::*;
diff --git a/core/layers/observe-metrics-common/src/lib.rs b/core/layers/observe-metrics-common/src/lib.rs
index 96d07eaae5..3ee72e4009 100644
--- a/core/layers/observe-metrics-common/src/lib.rs
+++ b/core/layers/observe-metrics-common/src/lib.rs
@@ -15,10 +15,11 @@
// specific language governing permissions and limitations
// under the License.
-//! OpenDAL Observability
-//!
-//! This library offers essential components to facilitate the implementation of observability in OpenDAL.
-//!
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
//! # OpenDAL Metrics Reference
//!
//! This document describes all metrics exposed by OpenDAL.
@@ -72,9 +73,6 @@
//! * **Counter**: Cumulative metric that only increases over time (resets on restart)
//! * **Gauge**: Point-in-time metric that can increase and decrease
-#![cfg_attr(docsrs, feature(doc_cfg))]
-#![deny(missing_docs)]
-
use std::fmt::Debug;
use std::fmt::Formatter;
use std::pin::Pin;
@@ -441,14 +439,22 @@ pub trait MetricsIntercept: Debug + Clone + Send + Sync + Unpin + 'static {
}
}
-/// `MetricsLayer` records OpenDAL operation metrics.
+/// `MetricsLayer` reports operation and HTTP metrics to an interceptor.
+///
+/// The layer wraps both the storage service and the HTTP transport in the
+/// operator's [`OperationContext`]. It reports the metric names and labels
+/// documented in the crate-level metrics reference through
+/// [`MetricsIntercept::observe`].
+///
+/// The interceptor must be cheap to clone because each wrapped operation and
+/// HTTP request can retain a clone.
#[derive(Clone, Debug)]
pub struct MetricsLayer<I: MetricsIntercept> {
interceptor: I,
}
impl<I: MetricsIntercept> MetricsLayer<I> {
- /// Create a new metrics layer.
+ /// Create a metrics layer that reports values to `interceptor`.
pub fn new(interceptor: I) -> Self {
Self { interceptor }
}
diff --git a/core/layers/otelmetrics/src/lib.rs b/core/layers/otelmetrics/src/lib.rs
index d98e6ade6b..92d0a67daa 100644
--- a/core/layers/otelmetrics/src/lib.rs
+++ b/core/layers/otelmetrics/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! OpenTelemetry metrics layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use opendal_core::OperationContext;
use opendal_core::raw::*;
use opendal_layer_observe_metrics_common as observe;
diff --git a/core/layers/oteltrace/README.md b/core/layers/oteltrace/README.md
index 3251a036d4..9288e32758 100644
--- a/core/layers/oteltrace/README.md
+++ b/core/layers/oteltrace/README.md
@@ -1,6 +1,7 @@
# Apache OpenDAL™ OpenTelemetry Trace Layer
-`opendal-layer-oteltrace` traces OpenDAL operations with OpenTelemetry.
+`opendal-layer-oteltrace` traces supported OpenDAL operations with
+OpenTelemetry's global tracer provider.
## Use through `opendal`
diff --git a/core/layers/oteltrace/src/lib.rs b/core/layers/oteltrace/src/lib.rs
index deb67e7fd6..d49f01a5ab 100644
--- a/core/layers/oteltrace/src/lib.rs
+++ b/core/layers/oteltrace/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! OpenTelemetry trace layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::sync::Arc;
use opendal_core::raw::*;
@@ -32,8 +31,17 @@ use opentelemetry::trace::Span;
use opentelemetry::trace::TraceContextExt;
use opentelemetry::trace::Tracer;
-/// `OtelTraceLayer` traces every operation with
-/// [opentelemetry::trace](https://docs.rs/opentelemetry/latest/opentelemetry/trace/index.html).
+/// `OtelTraceLayer` traces OpenDAL operations with
+/// [OpenTelemetry](https://docs.rs/opentelemetry/latest/opentelemetry/trace/index.html).
+///
+/// The layer obtains the `opendal` tracer from OpenTelemetry's global tracer
+/// provider. Applications must install and configure that provider before
+/// issuing operations.
+///
+/// The layer creates spans for service metadata, create, read, write, copy,
+/// rename, stat, list, and presign calls. It carries read, write, and list
+/// contexts into their stateful I/O bodies. Delete calls currently pass through
+/// without creating a span.
///
/// # Examples
///
diff --git a/core/layers/prometheus-client/src/lib.rs b/core/layers/prometheus-client/src/lib.rs
index 7b73eb3b6d..baa0e33b86 100644
--- a/core/layers/prometheus-client/src/lib.rs
+++ b/core/layers/prometheus-client/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Metrics layer (using the [prometheus-client](https://docs.rs/prometheus-client) crate) implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use opendal_core::OperationContext;
use opendal_core::raw::*;
use opendal_layer_observe_metrics_common as observe;
diff --git a/core/layers/prometheus/src/lib.rs b/core/layers/prometheus/src/lib.rs
index 47634b97c8..5b4651bb0f 100644
--- a/core/layers/prometheus/src/lib.rs
+++ b/core/layers/prometheus/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Metrics layer (using the [prometheus](https://docs.rs/prometheus) crate) implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use opendal_core::raw::*;
use opendal_core::*;
use opendal_layer_observe_metrics_common as observe;
diff --git a/core/layers/retry/src/lib.rs b/core/layers/retry/src/lib.rs
index a1f164e019..7371c83bf1 100644
--- a/core/layers/retry/src/lib.rs
+++ b/core/layers/retry/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Retry layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::fmt::Debug;
use std::sync::Arc;
diff --git a/core/layers/route/README.md b/core/layers/route/README.md
index 509a8a2d2d..31aeb997c2 100644
--- a/core/layers/route/README.md
+++ b/core/layers/route/README.md
@@ -37,6 +37,16 @@ fn add_layer(operator: Operator, layer: RouteLayer) -> Operator {
Construct and configure `layer` as described in the API documentation before
composing it with an operator.
+## Routing semantics
+
+- Routes are evaluated in the order they are added. The first matching glob
+ wins.
+- Paths that match no route continue through the operator wrapped by the
+ layer.
+- Copy and rename select a service from the source path. The layer does not
+ transfer data between two routed services.
+- Batched deletes route each path independently.
+
## Documentation
- [Rust API documentation](https://docs.rs/opendal-layer-route)
diff --git a/core/layers/route/src/lib.rs b/core/layers/route/src/lib.rs
index e916a946bb..64c762cd18 100644
--- a/core/layers/route/src/lib.rs
+++ b/core/layers/route/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Route layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::fmt::Debug;
use std::fmt::Formatter;
use std::sync::Arc;
@@ -30,8 +29,34 @@ use globset::GlobSetBuilder;
use opendal_core::raw::*;
use opendal_core::*;
-/// `RouteLayer` routes operations to different operators by matching paths with
-/// glob patterns.
+/// `RouteLayer` routes operations to different operators by matching paths
+/// against glob patterns.
+///
+/// Routes are evaluated in insertion order, and the first matching route wins.
+/// An unmatched path uses the operator wrapped by this layer. Copy and rename
+/// operations select a route from the source path, so this layer does not move
+/// data between two routed services. A batched delete routes each path
+/// independently.
+///
+/// [`OperatorInfo::capability`] continues to describe the wrapped operator; it
+/// does not aggregate the capabilities of route targets.
+///
+/// # Example
+///
+/// ```no_run
+/// use opendal_core::services::Memory;
+/// use opendal_core::{Operator, Result};
+/// use opendal_layer_route::RouteLayer;
+///
+/// fn build_operator() -> Result<Operator> {
+/// let archive = Operator::new(Memory::default())?;
+/// let routes = RouteLayer::builder()
+/// .route("archive/**", archive)
+/// .build()?;
+///
+/// Ok(Operator::new(Memory::default())?.layer(routes))
+/// }
+/// ```
#[derive(Clone, Debug)]
pub struct RouteLayer {
router: Arc<RouteRouter>,
@@ -51,7 +76,10 @@ pub struct RouteLayerBuilder {
}
impl RouteLayerBuilder {
- /// Add a route with a glob pattern.
+ /// Add a route for paths that match `pattern`.
+ ///
+ /// If multiple patterns match, the route added first wins. The target
+ /// operator contributes both its service and its operation context.
pub fn route(mut self, pattern: impl AsRef<str>, op: Operator) -> Self {
let (ctx, srv) = op.into_parts();
self.routes.push(RouteEntry {
@@ -61,9 +89,10 @@ impl RouteLayerBuilder {
self
}
- /// Build the `RouteLayer`.
+ /// Build the route layer.
///
- /// Returns an error if any glob pattern fails to compile.
+ /// This method returns [`ErrorKind::ConfigInvalid`] if a glob pattern is
+ /// invalid.
pub fn build(self) -> Result<RouteLayer> {
let mut builder = GlobSetBuilder::new();
let mut targets = Vec::with_capacity(self.routes.len());
@@ -143,7 +172,7 @@ impl RouteLayer {
}
}
-/// Service that routes operations to different targets based on path.
+#[doc(hidden)]
pub struct RouteAccessor {
inner: Servicer,
router: Arc<RouteRouter>,
@@ -264,7 +293,7 @@ impl Service for RouteAccessor {
}
}
-/// Deleter that batches deletions per routed service.
+#[doc(hidden)]
pub struct RouteDeleter {
default: Servicer,
router: Arc<RouteRouter>,
diff --git a/core/layers/tail-cut/src/lib.rs b/core/layers/tail-cut/src/lib.rs
index d13116db93..e824900672 100644
--- a/core/layers/tail-cut/src/lib.rs
+++ b/core/layers/tail-cut/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Tail cut layer (that automatically cancels long-tail requests) implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::fmt::Debug;
use std::sync::Arc;
use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
diff --git a/core/layers/throttle/src/lib.rs b/core/layers/throttle/src/lib.rs
index 05de87e404..02e502ac5b 100644
--- a/core/layers/throttle/src/lib.rs
+++ b/core/layers/throttle/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Throttle layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::num::NonZeroU32;
use std::sync::Arc;
diff --git a/core/layers/timeout/src/lib.rs b/core/layers/timeout/src/lib.rs
index e1c8211c77..86a04da0df 100644
--- a/core/layers/timeout/src/lib.rs
+++ b/core/layers/timeout/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Timeout layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::future::Future;
use std::sync::Arc;
use std::time::Duration;
diff --git a/core/layers/tracing/src/lib.rs b/core/layers/tracing/src/lib.rs
index fb457da1d4..b1f4dbe8ff 100644
--- a/core/layers/tracing/src/lib.rs
+++ b/core/layers/tracing/src/lib.rs
@@ -15,11 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Tracing layer implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-
use std::fmt::Debug;
use std::pin::Pin;
use std::sync::Arc;
diff --git a/core/services/aliyun-drive/src/docs.md b/core/services/aliyun-drive/src/docs.md
index 12e4f3634b..ccb206d1ca 100644
--- a/core/services/aliyun-drive/src/docs.md
+++ b/core/services/aliyun-drive/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,16 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work dir for backend.
-- `access_token`: Set the access_token for backend.
-- `client_id`: Set the client_id for backend.
-- `client_secret`: Set the client_secret for backend.
-- `refresh_token`: Set the refresh_token for backend.
-- `drive_type`: Set the drive_type for backend.
+## Configuration
-Refer to [`AliyunDriveBuilder`]'s public API docs for more information.
+Use [`crate::AliyunDriveConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/aliyun-drive/src/lib.rs b/core/services/aliyun-drive/src/lib.rs
index f930b38732..bfaceb052b 100644
--- a/core/services/aliyun-drive/src/lib.rs
+++ b/core/services/aliyun-drive/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for aliyun-drive service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const ALIYUN_DRIVE_SCHEME: &str = "aliyun-drive";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_aliyun_drive_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<AliyunDrive>(ALIYUN_DRIVE_SCHEME);
}
diff --git a/core/services/alluxio/src/docs.md b/core/services/alluxio/src/docs.md
index 652a81dbaf..367536cce7 100644
--- a/core/services/alluxio/src/docs.md
+++ b/core/services/alluxio/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,12 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `endpoint`: Customizable endpoint setting
+## Configuration
-You can refer to [`AlluxioBuilder`]'s docs for more information
+Use [`crate::AlluxioConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/alluxio/src/lib.rs b/core/services/alluxio/src/lib.rs
index 362e9f212a..fefd133be9 100644
--- a/core/services/alluxio/src/lib.rs
+++ b/core/services/alluxio/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for alluxio service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const ALLUXIO_SCHEME: &str = "alluxio";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_alluxio_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Alluxio>(ALLUXIO_SCHEME);
}
diff --git a/core/services/azblob/src/docs.md b/core/services/azblob/src/docs.md
index 85292ad25a..b925594150 100644
--- a/core/services/azblob/src/docs.md
+++ b/core/services/azblob/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,16 +12,14 @@ This service can be used to:
- [ ] rename
- [x] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work dir for backend.
-- `container`: Set the container name for backend.
-- `endpoint`: Set the endpoint for backend.
-- `account_name`: Set the account_name for backend.
-- `account_key`: Set the account_key for backend.
-- `batch_max_operations`: Deprecated. Azblob delete batch capability is enabled by default with Azure Blob's 256-operation batch limit and this option is no longer needed.
+## Configuration
-Refer to public API docs for more information.
+Use [`crate::AzblobConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Examples
diff --git a/core/services/azblob/src/lib.rs b/core/services/azblob/src/lib.rs
index 880cc90ad4..98b5b7ebb9 100644
--- a/core/services/azblob/src/lib.rs
+++ b/core/services/azblob/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for azblob service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const AZBLOB_SCHEME: &str = "azblob";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_azblob_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Azblob>(AZBLOB_SCHEME);
}
@@ -26,10 +36,12 @@ pub fn register_azblob_service(registry: &opendal_core::OperatorRegistry) {
mod backend;
mod config;
mod copier;
+#[doc(hidden)]
pub mod core;
mod deleter;
mod lister;
mod reader;
+#[doc(hidden)]
pub mod writer;
pub use backend::AzblobBuilder as Azblob;
diff --git a/core/services/azdls/src/docs.md b/core/services/azdls/src/docs.md
index 703f0ec41d..4b5711c661 100644
--- a/core/services/azdls/src/docs.md
+++ b/core/services/azdls/src/docs.md
@@ -8,7 +8,7 @@ This service will visit the [ABFS](https://learn.microsoft.com/en-us/azure/stora
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -20,15 +20,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work dir for backend.
-- `filesystem`: Set the filesystem name for backend.
-- `endpoint`: Set the endpoint for backend.
-- `account_name`: Set the account_name for backend.
-- `account_key`: Set the account_key for backend.
+## Configuration
-Refer to public API docs for more information.
+Use [`crate::AzdlsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/azdls/src/lib.rs b/core/services/azdls/src/lib.rs
index 47a41a693c..83ab1ba373 100644
--- a/core/services/azdls/src/lib.rs
+++ b/core/services/azdls/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for azdls service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const AZDLS_SCHEME: &str = "azdls";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_azdls_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Azdls>(AZDLS_SCHEME);
}
diff --git a/core/services/azfile/src/docs.md b/core/services/azfile/src/docs.md
index cbba46c579..4f55ee5836 100644
--- a/core/services/azfile/src/docs.md
+++ b/core/services/azfile/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,15 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work dir for backend.
-- `endpoint`: Set the endpoint for backend.
-- `account_name`: Set the account_name for backend.
-- `account_key`: Set the account_key for backend.
-- `share_name`: Set the share_name for backend.
+## Configuration
-Refer to public API docs for more information.
+Use [`crate::AzfileConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/azfile/src/lib.rs b/core/services/azfile/src/lib.rs
index 8e4ec9ff74..f8790aa754 100644
--- a/core/services/azfile/src/lib.rs
+++ b/core/services/azfile/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for azfile service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const AZFILE_SCHEME: &str = "azfile";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_azfile_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Azfile>(AZFILE_SCHEME);
}
diff --git a/core/services/azure-common/src/lib.rs b/core/services/azure-common/src/lib.rs
index 55e9cc90bd..46fa12c209 100644
--- a/core/services/azure-common/src/lib.rs
+++ b/core/services/azure-common/src/lib.rs
@@ -15,13 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-//! Azure Storage helpers.
-//!
-//! This module provides utilities and shared abstractions for services built
-//! on Azure Storage, such as Azure Blob Storage (`services-azblob`) or
-//! Azure Data Lake Storage (`services-azdls`).
use std::collections::HashMap;
diff --git a/core/services/b2/src/docs.md b/core/services/b2/src/docs.md
index 33118fade5..6d4ae7f63e 100644
--- a/core/services/b2/src/docs.md
+++ b/core/services/b2/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,15 +12,14 @@ This service can be used to:
- [ ] rename
- [x] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `key_id`: B2 application key keyID
-- `application_key` B2 application key applicationKey
-- `bucket` B2 bucket name
-- `bucket_id` B2 bucket_id
+## Configuration
-You can refer to [`B2Builder`]'s docs for more information
+Use [`crate::B2Config`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/b2/src/lib.rs b/core/services/b2/src/lib.rs
index a4fb661484..e3bc9dfc72 100644
--- a/core/services/b2/src/lib.rs
+++ b/core/services/b2/src/lib.rs
@@ -15,14 +15,20 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! B2 service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
-/// Default scheme for b2 service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const B2_SCHEME: &str = "b2";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_b2_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<B2>(B2_SCHEME);
}
diff --git a/core/services/cacache/src/docs.md b/core/services/cacache/src/docs.md
index 2ae2c4126a..2807a80671 100644
--- a/core/services/cacache/src/docs.md
+++ b/core/services/cacache/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,11 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `datadir`: Set the path to the cacache data directory
+## Configuration
-You can refer to [`CacacheBuilder`]'s docs for more information
+Use [`crate::CacacheConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/cacache/src/lib.rs b/core/services/cacache/src/lib.rs
index 2f3827a1e9..3bae139323 100644
--- a/core/services/cacache/src/lib.rs
+++ b/core/services/cacache/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Cacache service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +30,15 @@ mod writer;
pub use backend::CacacheBuilder as Cacache;
pub use config::CacacheConfig;
-/// Default scheme for cacache service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const CACACHE_SCHEME: &str = "cacache";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_cacache_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Cacache>(CACACHE_SCHEME);
}
diff --git a/core/services/cloudflare-kv/src/docs.md b/core/services/cloudflare-kv/src/docs.md
index e42b8d05c7..733d87e927 100644
--- a/core/services/cloudflare-kv/src/docs.md
+++ b/core/services/cloudflare-kv/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,9 +12,11 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `api_token`: Set the token of cloudflare api
-- `account_id`: Set the account identifier of cloudflare
-- `namespace_id`: Set the namespace identifier of d1
+Use [`crate::CloudflareKvConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
diff --git a/core/services/cloudflare-kv/src/lib.rs b/core/services/cloudflare-kv/src/lib.rs
index 705a5969cb..abb6532722 100644
--- a/core/services/cloudflare-kv/src/lib.rs
+++ b/core/services/cloudflare-kv/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Cloudflare KV service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +32,15 @@ mod writer;
pub use backend::CloudflareKvBuilder as CloudflareKv;
pub use config::CloudflareKvConfig;
-/// Default scheme for cloudflare-kv service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const CLOUDFLARE_KV_SCHEME: &str = "cloudflare-kv";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_cloudflare_kv_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<CloudflareKv>(CLOUDFLARE_KV_SCHEME);
}
diff --git a/core/services/compfs/src/lib.rs b/core/services/compfs/src/lib.rs
index 31f943ab5c..68657d9958 100644
--- a/core/services/compfs/src/lib.rs
+++ b/core/services/compfs/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Compfs service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +31,15 @@ mod writer;
pub use backend::CompfsBuilder as Compfs;
pub use config::CompfsConfig;
-/// Default scheme for compfs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const COMPFS_SCHEME: &str = "compfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_compfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Compfs>(COMPFS_SCHEME);
}
diff --git a/core/services/cos/src/docs.md b/core/services/cos/src/docs.md
index 69ea7a7cdf..23c320f296 100644
--- a/core/services/cos/src/docs.md
+++ b/core/services/cos/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,16 +12,14 @@ This service can be used to:
- [ ] rename
- [x] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `bucket`: Set the container name for backend
-- `endpoint`: Customizable endpoint setting
-- `access_key_id`: Set the access_key_id for backend.
-- `secret_access_key`: Set the secret_access_key for backend.
-- `enable_versioning`: Deprecated. COS versioning capability is enabled by default and this option is no longer needed.
+## Configuration
-You can refer to [`CosBuilder`]'s docs for more information
+Use [`crate::CosConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/cos/src/lib.rs b/core/services/cos/src/lib.rs
index 3ef6337515..ac7be849d5 100644
--- a/core/services/cos/src/lib.rs
+++ b/core/services/cos/src/lib.rs
@@ -15,7 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for cos service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const COS_SCHEME: &str = "cos";
/// Alternative scheme for cos service.
@@ -26,7 +31,12 @@ pub const COS_SCHEME: &str = "cos";
/// workloads can switch to OpenDAL without changing their URIs.
pub const COSN_SCHEME: &str = "cosn";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
///
/// Both the canonical `cos` scheme and the Hadoop-compatible `cosn`
/// alias are registered so that URIs like `cos://bucket/key` and
diff --git a/core/services/d1/src/docs.md b/core/services/d1/src/docs.md
index 0d65b38caa..527c3edcf8 100644
--- a/core/services/d1/src/docs.md
+++ b/core/services/d1/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,15 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `token`: Set the token of cloudflare api
-- `account_id`: Set the account id of cloudflare api
-- `database_id`: Set the database id of cloudflare api
-- `table`: Set the table of D1 Database
-- `key_field`: Set the key field of D1 Database
-- `value_field`: Set the value field of D1 Database
+Use [`crate::D1Config`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/d1/src/lib.rs b/core/services/d1/src/lib.rs
index 4f5e3ff144..fd2ac90bf2 100644
--- a/core/services/d1/src/lib.rs
+++ b/core/services/d1/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Cloudflare D1 service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +31,15 @@ mod writer;
pub use backend::D1Builder as D1;
pub use config::D1Config;
-/// Default scheme for d1 service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const D1_SCHEME: &str = "d1";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_d1_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<D1>(D1_SCHEME);
}
diff --git a/core/services/dashmap/src/docs.md b/core/services/dashmap/src/docs.md
index c1e4626063..0cea5f4099 100644
--- a/core/services/dashmap/src/docs.md
+++ b/core/services/dashmap/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,11 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the root path for this dashmap instance.
+## Configuration
-You can refer to [`DashmapBuilder`]'s docs for more information
+Use [`crate::DashmapConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/dashmap/src/lib.rs b/core/services/dashmap/src/lib.rs
index 96254ed7a9..75406be1fc 100644
--- a/core/services/dashmap/src/lib.rs
+++ b/core/services/dashmap/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Dashmap service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::DashmapBuilder as Dashmap;
pub use config::DashmapConfig;
-/// Default scheme for dashmap service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const DASHMAP_SCHEME: &str = "dashmap";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_dashmap_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Dashmap>(DASHMAP_SCHEME);
}
diff --git a/core/services/dbfs/src/docs.md b/core/services/dbfs/src/docs.md
index b22268beb8..e00ef3309a 100644
--- a/core/services/dbfs/src/docs.md
+++ b/core/services/dbfs/src/docs.md
@@ -2,7 +2,7 @@ This service will visit the [DBFS API](https://docs.databricks.com/api/azure/wor
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -14,13 +14,14 @@ This service can be used to:
- [x] list
- [ ] ~~presign~~
-## Configurations
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend.
-- `endpoint`: Set the endpoint for backend.
-- `token`: Databricks personal access token.
+## Configuration
-Refer to [`DbfsBuilder`]'s public API docs for more information.
+Use [`crate::DbfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Examples
diff --git a/core/services/dbfs/src/lib.rs b/core/services/dbfs/src/lib.rs
index 51b8f07db3..6a03d4aca8 100644
--- a/core/services/dbfs/src/lib.rs
+++ b/core/services/dbfs/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Dbfs service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +30,15 @@ mod writer;
pub use backend::DbfsBuilder as Dbfs;
pub use config::DbfsConfig;
-/// Default scheme for dbfs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const DBFS_SCHEME: &str = "dbfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_dbfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Dbfs>(DBFS_SCHEME);
}
diff --git a/core/services/dropbox/src/docs.md b/core/services/dropbox/src/docs.md
index 15a3735d96..08c6a55150 100644
--- a/core/services/dropbox/src/docs.md
+++ b/core/services/dropbox/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -11,9 +11,14 @@ This service can be used to:
- [x] copy
- [x] rename
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the work directory for this backend.
+Use [`crate::DropboxConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
### Credentials related
@@ -38,8 +43,6 @@ and exchange it for refresh token.
Please refer to [Dropbox OAuth2 Guide](https://www.dropbox.com/developers/reference/oauth-guide)
for more information.
-You can refer to [`DropboxBuilder`]'s docs for more information
-
## Example
### Via Builder
diff --git a/core/services/dropbox/src/lib.rs b/core/services/dropbox/src/lib.rs
index 6921e1c56e..3701946b3f 100644
--- a/core/services/dropbox/src/lib.rs
+++ b/core/services/dropbox/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Dropbox service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::DropboxBuilder as Dropbox;
pub use config::DropboxConfig;
-/// Default scheme for dropbox service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const DROPBOX_SCHEME: &str = "dropbox";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_dropbox_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Dropbox>(DROPBOX_SCHEME);
}
diff --git a/core/services/etcd/src/docs.md b/core/services/etcd/src/docs.md
index 6827623282..d38ea007c0 100644
--- a/core/services/etcd/src/docs.md
+++ b/core/services/etcd/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,17 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the working directory of `OpenDAL`
-- `endpoints`: Set the network address of etcd servers
-- `username`: Set the username of Etcd
-- `password`: Set the password for authentication
-- `ca_path`: Set the ca path to the etcd connection
-- `cert_path`: Set the cert path to the etcd connection
-- `key_path`: Set the key path to the etcd connection
+## Configuration
-You can refer to [`EtcdBuilder`]'s docs for more information
+Use [`crate::EtcdConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/etcd/src/lib.rs b/core/services/etcd/src/lib.rs
index c37a28b53e..23edf623eb 100644
--- a/core/services/etcd/src/lib.rs
+++ b/core/services/etcd/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Etcd service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::EtcdBuilder as Etcd;
pub use config::EtcdConfig;
-/// Default scheme for etcd service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const ETCD_SCHEME: &str = "etcd";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_etcd_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Etcd>(ETCD_SCHEME);
}
diff --git a/core/services/foundationdb/src/docs.md b/core/services/foundationdb/src/docs.md
index 27399e842a..900dc79491 100644
--- a/core/services/foundationdb/src/docs.md
+++ b/core/services/foundationdb/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,14 +12,16 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
**Note**: As for [Known Limitations - FoundationDB](https://apple.github.io/foundationdb/known-limitations), keys cannot exceed 10,000 bytes in size, and values cannot exceed 100,000 bytes in size. Errors will be raised by OpenDAL if these limits are exceeded.
## Configuration
-- `root`: Set the work directory for this backend.
-- `config_path`: Set the configuration path for foundationdb. If not provided, the default configuration path will be used.
-
-You can refer to [`FoundationdbBuilder`]'s docs for more information
+Use [`crate::FoundationdbConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/foundationdb/src/lib.rs b/core/services/foundationdb/src/lib.rs
index fcead9ce5e..6221d0684e 100644
--- a/core/services/foundationdb/src/lib.rs
+++ b/core/services/foundationdb/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Foundationdb service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +30,15 @@ mod writer;
pub use backend::FoundationdbBuilder as Foundationdb;
pub use config::FoundationdbConfig;
-/// Default scheme for foundationdb service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const FOUNDATIONDB_SCHEME: &str = "foundationdb";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_foundationdb_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Foundationdb>(FOUNDATIONDB_SCHEME);
}
diff --git a/core/services/foyer/README.md b/core/services/foyer/README.md
index e23490d2c4..9b97977003 100644
--- a/core/services/foyer/README.md
+++ b/core/services/foyer/README.md
@@ -1,7 +1,8 @@
# Apache OpenDAL™ Foyer Service
-`opendal-service-foyer` provides a storage backend backed by the Foyer hybrid cache for
-applications built with Apache OpenDAL™.
+`opendal-service-foyer` provides a volatile storage backend backed by the Foyer
+hybrid cache for applications built with Apache OpenDAL™. Foyer can evict data
+when the cache is full, so do not use this service for persistent storage.
## Use through `opendal`
diff --git a/core/services/foyer/src/docs.md b/core/services/foyer/src/docs.md
index c83bba8380..15e153e86c 100644
--- a/core/services/foyer/src/docs.md
+++ b/core/services/foyer/src/docs.md
@@ -8,7 +8,7 @@ when the cache is full.
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] stat
- [x] read
@@ -17,8 +17,15 @@ This service can be used to:
- [ ] list (not supported)
- [ ] blocking (not supported)
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
+Use [`crate::FoyerConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
+
Foyer service can be configured in two ways:
1. **Pre-configured cache**: Pass a fully configured `HybridCache` instance for maximum control
@@ -101,9 +108,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
```rust,no_run
use opendal::Operator;
+use opendal::OperatorRegistry;
+use opendal_service_foyer::register_foyer_service;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ register_foyer_service(OperatorRegistry::get());
+
// Memory-only cache via URI
let op = Operator::from_uri("foyer:///?memory=67108864")?;
diff --git a/core/services/foyer/src/lib.rs b/core/services/foyer/src/lib.rs
index b40120ece5..b523002478 100644
--- a/core/services/foyer/src/lib.rs
+++ b/core/services/foyer/src/lib.rs
@@ -15,16 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Foyer service implementation for Apache OpenDAL.
-//!
-//! Foyer is a high-performance hybrid cache library that supports both
-//! in-memory and on-disk caching. This service provides foyer as a
-//! volatile KV storage backend, similar to using Redis as a cache.
-//!
-//! Note: Data stored in foyer may be evicted when the cache is full.
-//! Do not use this service for persistent storage.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -44,7 +37,7 @@ use opendal_core::Buffer;
pub use backend::FoyerBuilder as Foyer;
pub use config::FoyerConfig;
-/// Default scheme for foyer service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const FOYER_SCHEME: &str = "foyer";
/// [`FoyerKey`] is a key for the foyer cache.
@@ -121,7 +114,12 @@ impl Code for FoyerValue {
}
}
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_foyer_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Foyer>(FOYER_SCHEME);
}
diff --git a/core/services/fs/src/docs.md b/core/services/fs/src/docs.md
index a1e73dc0a3..952fc7424c 100644
--- a/core/services/fs/src/docs.md
+++ b/core/services/fs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,17 +12,19 @@ This service can be used to:
- [x] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the work dir for backend.
--
-You can refer to [`FsBuilder`]'s docs for more information
+Use [`crate::FsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
### Via Builder
-
```rust,ignore
use std::sync::Arc;
diff --git a/core/services/fs/src/lib.rs b/core/services/fs/src/lib.rs
index faff49144b..ff4819797a 100644
--- a/core/services/fs/src/lib.rs
+++ b/core/services/fs/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Fs service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,12 +31,17 @@ mod writer;
pub use backend::FsBuilder as Fs;
pub use config::FsConfig;
-/// Default scheme for fs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const FS_SCHEME: &str = "fs";
/// Alias scheme for fs service that follows the standard URI scheme.
pub const FILE_SCHEME: &str = "file";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_fs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Fs>(FS_SCHEME);
registry.register::<Fs>(FILE_SCHEME);
diff --git a/core/services/ftp/src/docs.md b/core/services/ftp/src/docs.md
index 6d2fb9d984..87bfe9f4a2 100644
--- a/core/services/ftp/src/docs.md
+++ b/core/services/ftp/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `endpoint`: Set the endpoint for connection
-- `root`: Set the work directory for backend
-- `user`: Set the login user
-- `password`: Set the login password
+## Configuration
-You can refer to [`FtpBuilder`]'s docs for more information
+Use [`crate::FtpConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/ftp/src/lib.rs b/core/services/ftp/src/lib.rs
index 9de67a7207..cfe7bc5e90 100644
--- a/core/services/ftp/src/lib.rs
+++ b/core/services/ftp/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for ftp service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const FTP_SCHEME: &str = "ftp";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_ftp_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Ftp>(FTP_SCHEME);
}
diff --git a/core/services/gcs/src/docs.md b/core/services/gcs/src/docs.md
index 12d6c0342f..3f2f3c471a 100644
--- a/core/services/gcs/src/docs.md
+++ b/core/services/gcs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,20 +12,14 @@ This service can be used to:
- [ ] rename
- [x] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `bucket`: Set the container name for backend
-- `endpoint`: Customizable endpoint setting
-- `credential`: Service Account or External Account JSON, in base64
-- `credential_path`: local path to Service Account or External Account JSON file
-- `service_account`: name of Service Account
-- `predefined_acl`: Predefined ACL for GCS
-- `default_storage_class`: Default storage class for GCS
-- `skip_signature`: Skip loading credentials and signing requests.
-- `allow_anonymous`: Deprecated. Use `skip_signature` instead.
+## Configuration
-Refer to public API docs for more information. For authentication related options, read on.
+Use [`crate::GcsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Options to authenticate to GCS
diff --git a/core/services/gcs/src/lib.rs b/core/services/gcs/src/lib.rs
index 637e5a8e8a..0de44aca8d 100644
--- a/core/services/gcs/src/lib.rs
+++ b/core/services/gcs/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Google Cloud Storage service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +32,15 @@ mod writer;
pub use backend::GcsBuilder as Gcs;
pub use config::GcsConfig;
-/// Default scheme for gcs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const GCS_SCHEME: &str = "gcs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_gcs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Gcs>(GCS_SCHEME);
}
diff --git a/core/services/gdrive/src/docs.md b/core/services/gdrive/src/docs.md
index 0177987da4..7cec67cf37 100644
--- a/core/services/gdrive/src/docs.md
+++ b/core/services/gdrive/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,15 +12,20 @@ This service can be used to:
- [x] rename
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Behavior Notes
Google Drive allows duplicate file or directory names under the same parent.
When multiple entries match the same path, OpenDAL resolves the most recently
modified match, falling back to the newer creation time if needed.
-# Configuration
+## Configuration
-- `root`: Set the work directory for backend
+Use [`crate::GdriveConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
### Credentials related
@@ -48,8 +53,6 @@ And your OAuth scope contains `https://www.googleapis.com/auth/drive`.
Please refer to [GoogleDrive OAuth2 Flow](https://developers.google.com/identity/protocols/oauth2/)
for more information.
-You can refer to [`GdriveBuilder`]'s docs for more information
-
## Example
### Via Builder
diff --git a/core/services/gdrive/src/lib.rs b/core/services/gdrive/src/lib.rs
index dc9101a10c..e67f389744 100644
--- a/core/services/gdrive/src/lib.rs
+++ b/core/services/gdrive/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for gdrive service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const GDRIVE_SCHEME: &str = "gdrive";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_gdrive_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Gdrive>(GDRIVE_SCHEME);
}
diff --git a/core/services/ghac/src/docs.md b/core/services/ghac/src/docs.md
index e04fe0c1e7..6422b9ceda 100644
--- a/core/services/ghac/src/docs.md
+++ b/core/services/ghac/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,6 +12,9 @@ This service can be used to:
- [ ] rename
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Notes
This service is mainly provided by GitHub actions.
@@ -52,9 +55,9 @@ be automatically evicted at any time.
## Configuration
-- `root`: Set the work dir for backend.
-
-Refer to [`GhacBuilder`]'s public API docs for more information.
+Use [`crate::GhacConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/ghac/src/lib.rs b/core/services/ghac/src/lib.rs
index d010b8aa4a..efa932c723 100644
--- a/core/services/ghac/src/lib.rs
+++ b/core/services/ghac/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for ghac service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const GHAC_SCHEME: &str = "ghac";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_ghac_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Ghac>(GHAC_SCHEME);
}
diff --git a/core/services/github/src/docs.md b/core/services/github/src/docs.md
index 77b35e19a1..7858be0a07 100644
--- a/core/services/github/src/docs.md
+++ b/core/services/github/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `token`: Github access token
-- `owner`: Github owner
-- `repo`: Github repository
+## Configuration
-You can refer to [`GithubBuilder`]'s docs for more information
+Use [`crate::GithubConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
@@ -43,7 +43,6 @@ async fn main() -> Result<()> {
// set the repository for Github
.repo("your_repo");
-
let op: Operator = Operator::new(builder)?;
Ok(())
diff --git a/core/services/github/src/lib.rs b/core/services/github/src/lib.rs
index afee634127..e7a2e1d424 100644
--- a/core/services/github/src/lib.rs
+++ b/core/services/github/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for github service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const GITHUB_SCHEME: &str = "github";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_github_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Github>(GITHUB_SCHEME);
}
diff --git a/core/services/goosefs/src/docs.md b/core/services/goosefs/src/docs.md
index df81ed6a83..1f78290e79 100644
--- a/core/services/goosefs/src/docs.md
+++ b/core/services/goosefs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -13,6 +13,9 @@ This service can be used to:
- [x] rename (if_not_exists)
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Notes
GooseFS service uses native gRPC protocol (not REST API like Alluxio),
@@ -29,15 +32,9 @@ Features:
## Configuration
-- `root`: Set the work directory for backend
-- `master_addr`: GooseFS Master address (`host:port`), supports comma-separated for HA
-- `block_size`: Block size for new files (default: 64 MiB)
-- `chunk_size`: Chunk size for streaming RPCs (default: 1 MiB)
-- `write_type`: Default write type (`must_cache`, `cache_through`, `through`, `async_through`)
-- `auth_type`: Authentication type (`nosasl`, `simple`). Default: `simple`
-- `auth_username`: Authentication username for SIMPLE mode. Default: current OS user
-
-You can refer to [`GoosefsBuilder`]'s docs for more information
+Use [`crate::GoosefsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/goosefs/src/lib.rs b/core/services/goosefs/src/lib.rs
index 26216d40e5..8880fda0a1 100644
--- a/core/services/goosefs/src/lib.rs
+++ b/core/services/goosefs/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for GooseFS service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const GOOSEFS_SCHEME: &str = "goosefs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_goosefs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<GooseFs>(GOOSEFS_SCHEME);
}
diff --git a/core/services/gridfs/src/docs.md b/core/services/gridfs/src/docs.md
index a7f42e8a92..df98f06d44 100644
--- a/core/services/gridfs/src/docs.md
+++ b/core/services/gridfs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,13 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `connection_string`: Set the connection string of mongodb server
-- `database`: Set the database of mongodb
-- `bucket`: Set the bucket of mongodb gridfs
-- `chunk_size`: Set the chunk size of mongodb gridfs
+Use [`crate::GridfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/gridfs/src/lib.rs b/core/services/gridfs/src/lib.rs
index 7a66fb9985..6060a0fca5 100644
--- a/core/services/gridfs/src/lib.rs
+++ b/core/services/gridfs/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! GridFS service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +30,15 @@ mod writer;
pub use backend::GridfsBuilder as Gridfs;
pub use config::GridfsConfig;
-/// Default scheme for gridfs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const GRIDFS_SCHEME: &str = "gridfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_gridfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Gridfs>(GRIDFS_SCHEME);
}
diff --git a/core/services/hdfs-native/src/backend.rs b/core/services/hdfs-native/src/backend.rs
index 3f9fc0d083..fc9e6670b6 100644
--- a/core/services/hdfs-native/src/backend.rs
+++ b/core/services/hdfs-native/src/backend.rs
@@ -81,7 +81,8 @@ impl HdfsNativeBuilder {
/// Set other hdfs-native client options of this backend.
///
- /// Currently the supported configs refer to (https://github.com/Kimahriman/hdfs-native)
+ /// See the [hdfs-native documentation](https://github.com/Kimahriman/hdfs-native)
+ /// for the supported options.
pub fn options(mut self, options: HashMap<String, String>) -> Self {
self.config.options = Some(options);
self
diff --git a/core/services/hdfs-native/src/docs.md b/core/services/hdfs-native/src/docs.md
index 6b2f104cb9..bc1c0115ca 100644
--- a/core/services/hdfs-native/src/docs.md
+++ b/core/services/hdfs-native/src/docs.md
@@ -3,7 +3,7 @@ Using [Native Rust HDFS client](https://github.com/Kimahriman/hdfs-native).
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -15,8 +15,11 @@ This service can be used to:
- [x] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the work dir for backend.
-- `name_node`: Set the name node for backend.
-- `enable_append`: Deprecated. HDFS Native append capability is enabled by default and this option is no longer needed.
+Use [`crate::HdfsNativeConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
diff --git a/core/services/hdfs-native/src/lib.rs b/core/services/hdfs-native/src/lib.rs
index dbd2caf637..4775a5b4e8 100644
--- a/core/services/hdfs-native/src/lib.rs
+++ b/core/services/hdfs-native/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for hdfs-native service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const HDFS_NATIVE_SCHEME: &str = "hdfs-native";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_hdfs_native_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<HdfsNative>(HDFS_NATIVE_SCHEME);
}
diff --git a/core/services/hdfs/src/docs.md b/core/services/hdfs/src/docs.md
index dae3eb5fe6..97765d3f5e 100644
--- a/core/services/hdfs/src/docs.md
+++ b/core/services/hdfs/src/docs.md
@@ -2,7 +2,7 @@ A distributed file system that provides high-throughput access to application da
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -14,9 +14,13 @@ This service can be used to:
- [x] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Differences with webhdfs
-[Webhdfs][crate::services::Webhdfs] is powered by hdfs's RESTful HTTP API.
+The [WebHDFS service](https://docs.rs/opendal-service-webhdfs) uses HDFS's
+RESTful HTTP API.
## Features
@@ -24,13 +28,9 @@ HDFS support needs to enable feature `services-hdfs`.
## Configuration
-- `root`: Set the work dir for backend.
-- `name_node`: Set the name node for backend.
-- `kerberos_ticket_cache_path`: Set the kerberos ticket cache path for backend, this should be gotten by `klist` after `kinit`
-- `user`: Set the user for backend
-- `enable_append`: Deprecated. HDFS append capability is enabled by default and this option is no longer needed.
-
-Refer to [`HdfsBuilder`]'s public API docs for more information.
+Use [`crate::HdfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Environment
diff --git a/core/services/hdfs/src/lib.rs b/core/services/hdfs/src/lib.rs
index c24c355380..0836e1fc18 100644
--- a/core/services/hdfs/src/lib.rs
+++ b/core/services/hdfs/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for hdfs service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const HDFS_SCHEME: &str = "hdfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_hdfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Hdfs>(HDFS_SCHEME);
}
diff --git a/core/services/hf/src/backend.rs b/core/services/hf/src/backend.rs
index 907568f8f8..f15e5f87fd 100644
--- a/core/services/hf/src/backend.rs
+++ b/core/services/hf/src/backend.rs
@@ -133,10 +133,12 @@ impl HfBuilder {
self
}
- /// configure the Hub base url. You might want to set this variable if your
- /// organization is using a Private Hub https://huggingface.co/enterprise
+ /// Set the Hub base URL.
///
- /// Default is "https://huggingface.co"
+ /// Configure this when your organization uses a
+ /// [Private Hub](https://huggingface.co/enterprise).
+ ///
+ /// The default is `https://huggingface.co`.
pub fn endpoint(mut self, endpoint: &str) -> Self {
if !endpoint.is_empty() {
self.config.endpoint = Some(endpoint.to_string());
diff --git a/core/services/hf/src/config.rs b/core/services/hf/src/config.rs
index ccc6d67b23..ea7db3f962 100644
--- a/core/services/hf/src/config.rs
+++ b/core/services/hf/src/config.rs
@@ -50,7 +50,7 @@ pub struct HfConfig {
pub token: Option<String>,
/// Endpoint of the Hugging Face Hub.
///
- /// Default is "https://huggingface.co".
+ /// The default is `https://huggingface.co`.
pub endpoint: Option<String>,
/// Download mode. Either `xet` (default) or `http`.
///
diff --git a/core/services/hf/src/docs.md b/core/services/hf/src/docs.md
index bcb5ef710e..4493bbab72 100644
--- a/core/services/hf/src/docs.md
+++ b/core/services/hf/src/docs.md
@@ -11,7 +11,7 @@ This service supports two storage backends:
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -23,17 +23,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configurations
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `repo_type`: The type of the repository. One of `model`, `dataset`, `space`, or `bucket`.
-- `repo_id`: The id of the repository.
-- `revision`: The revision of the repository. Only applicable for git-based repo types (`model`, `dataset`, `space`).
-- `root`: Set the work directory for backend.
-- `token`: The token for accessing the repository. Required for write operations.
-- `endpoint`: The Hub base URL. Default is `https://huggingface.co`. Can also be set via the `HF_ENDPOINT` environment variable.
-- `download_mode`: How files are downloaded. One of `xet` (default) or `http`. When unset, a non-empty `HF_HUB_DISABLE_XET` environment variable forces `http`.
+## Configuration
-Refer to [`HfBuilder`]'s public API docs for more information.
+Use [`crate::HfConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Examples
@@ -82,11 +79,13 @@ async fn main() -> Result<()> {
### Via URI
```rust,no_run
-use opendal_core::Operator;
-use opendal_core::Result;
+use opendal_core::{Operator, OperatorRegistry, Result};
+use opendal_service_hf::register_hf_service;
#[tokio::main]
async fn main() -> Result<()> {
+ register_hf_service(OperatorRegistry::get());
+
// Git-based dataset
let op = Operator::from_uri((
"hf://datasets/username/my-dataset@main",
diff --git a/core/services/hf/src/lib.rs b/core/services/hf/src/lib.rs
index 8a4fd45e7e..250e0bdf60 100644
--- a/core/services/hf/src/lib.rs
+++ b/core/services/hf/src/lib.rs
@@ -15,13 +15,23 @@
// specific language governing permissions and limitations
// under the License.
-/// Primary scheme for the Hugging Face service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// Primary URI scheme registered for the Hugging Face service.
pub const HF_SCHEME: &str = "hf";
-/// Alias scheme for the Hugging Face service.
+/// Alias URI scheme registered for the Hugging Face service.
pub const HUGGINGFACE_SCHEME: &str = "huggingface";
-/// Register this service into the given registry under both `hf` and `huggingface` schemes.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_hf_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Hf>(HF_SCHEME);
registry.register::<Hf>(HUGGINGFACE_SCHEME);
diff --git a/core/services/http/src/docs.md b/core/services/http/src/docs.md
index 8cea47aca1..f61f65a1b4 100644
--- a/core/services/http/src/docs.md
+++ b/core/services/http/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] ~~create_dir~~
- [x] stat
@@ -12,6 +12,9 @@ This service can be used to:
- [ ] ~~rename~~
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Notes
Only `read` and `stat` are supported. We can use this service to visit any
@@ -19,10 +22,9 @@ HTTP Server like nginx, caddy.
## Configuration
-- `endpoint`: set the endpoint for http
-- `root`: Set the work directory for backend
-
-You can refer to [`HttpBuilder`]'s docs for more information
+Use [`crate::HttpConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/http/src/lib.rs b/core/services/http/src/lib.rs
index fb31d759ad..f5994187d2 100644
--- a/core/services/http/src/lib.rs
+++ b/core/services/http/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! HTTP service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -27,13 +28,18 @@ mod reader;
pub use backend::HttpBuilder as Http;
pub use config::HttpConfig;
-/// Default scheme for http service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const HTTP_SCHEME: &str = "http";
-/// Alias for http service scheme for https connections.
+/// Alias URI scheme used for HTTPS connections.
pub const HTTPS_SCHEME: &str = "https";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_http_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Http>(HTTP_SCHEME);
registry.register::<Http>(HTTPS_SCHEME);
diff --git a/core/services/ipfs/src/docs.md b/core/services/ipfs/src/docs.md
index 9bcb72cfce..9166443ae3 100644
--- a/core/services/ipfs/src/docs.md
+++ b/core/services/ipfs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] ~~create_dir~~
- [x] stat
@@ -12,12 +12,14 @@ This service can be used to:
- [ ] ~~rename~~
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `endpoint`: Customizable endpoint setting
+## Configuration
-You can refer to [`IpfsBuilder`]'s docs for more information
+Use [`crate::IpfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/ipfs/src/lib.rs b/core/services/ipfs/src/lib.rs
index cd48e96b10..b7b409d5cf 100644
--- a/core/services/ipfs/src/lib.rs
+++ b/core/services/ipfs/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! IPFS service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -28,10 +29,15 @@ mod reader;
pub use backend::IpfsBuilder as Ipfs;
pub use config::IpfsConfig;
-/// Default scheme for ipfs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const IPFS_SCHEME: &str = "ipfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_ipfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Ipfs>(IPFS_SCHEME);
}
diff --git a/core/services/ipmfs/src/docs.md b/core/services/ipmfs/src/docs.md
index daff9c0cc1..d99066502b 100644
--- a/core/services/ipmfs/src/docs.md
+++ b/core/services/ipmfs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -11,3 +11,12 @@ This service can be used to:
- [ ] copy
- [ ] rename
- [ ] presign
+
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
+## Configuration
+
+Use [`crate::IpmfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
diff --git a/core/services/ipmfs/src/lib.rs b/core/services/ipmfs/src/lib.rs
index 20bc3b040f..6f3fc7a57c 100644
--- a/core/services/ipmfs/src/lib.rs
+++ b/core/services/ipmfs/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for ipmfs service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const IPMFS_SCHEME: &str = "ipmfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_ipmfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Ipmfs>(IPMFS_SCHEME);
}
diff --git a/core/services/koofr/src/docs.md b/core/services/koofr/src/docs.md
index 5d9fcb46e1..744d8d03d0 100644
--- a/core/services/koofr/src/docs.md
+++ b/core/services/koofr/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `endpoint`: Koofr endpoint
-- `email` Koofr email
-- `password` Koofr password
+## Configuration
-You can refer to [`KoofrBuilder`]'s docs for more information
+Use [`crate::KoofrConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/koofr/src/lib.rs b/core/services/koofr/src/lib.rs
index 744eb08961..fab39982d4 100644
--- a/core/services/koofr/src/lib.rs
+++ b/core/services/koofr/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for koofr service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const KOOFR_SCHEME: &str = "koofr";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_koofr_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Koofr>(KOOFR_SCHEME);
}
diff --git a/core/services/lakefs/src/docs.md b/core/services/lakefs/src/docs.md
index 9a53826908..71551098a7 100644
--- a/core/services/lakefs/src/docs.md
+++ b/core/services/lakefs/src/docs.md
@@ -5,7 +5,7 @@ Lakefs doesn't host official HTTP API docs. Detailed HTTP request API informatio
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -17,16 +17,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configurations
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `endpoint`: The endpoint of the Lakefs repository.
-- `repository`: The id of the repository.
-- `branch`: The branch of the repository.
-- `root`: Set the work directory for backend.
-- `username`: The username for accessing the repository.
-- `password`: The password for accessing the repository.
+## Configuration
-Refer to [`LakefsBuilder`]'s public API docs for more information.
+Use [`crate::LakefsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Examples
diff --git a/core/services/lakefs/src/lib.rs b/core/services/lakefs/src/lib.rs
index a24b09ebbd..78d9dc14b5 100644
--- a/core/services/lakefs/src/lib.rs
+++ b/core/services/lakefs/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! lakeFS service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::LakefsBuilder as Lakefs;
pub use config::LakefsConfig;
-/// Default scheme for lakefs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const LAKEFS_SCHEME: &str = "lakefs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_lakefs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Lakefs>(LAKEFS_SCHEME);
}
diff --git a/core/services/memcached/Cargo.toml b/core/services/memcached/Cargo.toml
index 59638c35a9..33119b06cf 100644
--- a/core/services/memcached/Cargo.toml
+++ b/core/services/memcached/Cargo.toml
@@ -35,7 +35,7 @@ all-features = true
fastpool = "1.0.2"
opendal-core = { path = "../../core", version = "0.58.1", default-features = false }
serde = { workspace = true, features = ["derive"] }
-tokio = { workspace = true, features = ["net", "io-util"] }
+tokio = { workspace = true, features = ["io-util", "macros", "net", "time"] }
url = { workspace = true }
[dev-dependencies]
diff --git a/core/services/memcached/src/docs.md b/core/services/memcached/src/docs.md
index c94a1d1e57..53d33f6b54 100644
--- a/core/services/memcached/src/docs.md
+++ b/core/services/memcached/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,15 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the working directory of `OpenDAL`
-- `username`: Set the username for authentication.
-- `password`: Set the password for authentication.
-- `endpoint`: Set the network address of memcached server
-- `default_ttl`: Set the ttl for memcached service.
+## Configuration
-You can refer to [`MemcachedBuilder`]'s docs for more information
+Use [`crate::MemcachedConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/memcached/src/lib.rs b/core/services/memcached/src/lib.rs
index 6fd58dfac2..f49b4fede4 100644
--- a/core/services/memcached/src/lib.rs
+++ b/core/services/memcached/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Memcached service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::MemcachedBuilder as Memcached;
pub use config::MemcachedConfig;
-/// Default scheme for memcached service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const MEMCACHED_SCHEME: &str = "memcached";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_memcached_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Memcached>(MEMCACHED_SCHEME);
}
diff --git a/core/services/mini_moka/src/docs.md b/core/services/mini_moka/src/docs.md
index 62aeae2672..a58ac1159f 100644
--- a/core/services/mini_moka/src/docs.md
+++ b/core/services/mini_moka/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,6 +12,15 @@ This service can be used to:
- [ ] rename
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
+## Configuration
+
+Use [`crate::MiniMokaConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
+
## Notes
To better assist you in choosing the right cache for your use case,
diff --git a/core/services/mini_moka/src/lib.rs b/core/services/mini_moka/src/lib.rs
index 4cd755319d..3fc9829a04 100644
--- a/core/services/mini_moka/src/lib.rs
+++ b/core/services/mini_moka/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Mini-moka service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::MiniMokaBuilder as MiniMoka;
pub use config::MiniMokaConfig;
-/// Default scheme for mini-moka service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const MINI_MOKA_SCHEME: &str = "mini-moka";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_mini_moka_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<MiniMoka>(MINI_MOKA_SCHEME);
}
diff --git a/core/services/moka/src/docs.md b/core/services/moka/src/docs.md
index 93767a0ed7..5d318fdbc9 100644
--- a/core/services/moka/src/docs.md
+++ b/core/services/moka/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `name`: Set the name for this cache instance.
-- `max_capacity`: Set the max capacity of the cache.
-- `time_to_live`: Set the time to live of the cache.
-- `time_to_idle`: Set the time to idle of the cache.
+## Configuration
-You can refer to [`MokaBuilder`]'s docs for more information
+Use [`crate::MokaConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/moka/src/lib.rs b/core/services/moka/src/lib.rs
index 11a2a382ba..d3528c5fac 100644
--- a/core/services/moka/src/lib.rs
+++ b/core/services/moka/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Moka service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -32,10 +33,15 @@ pub use backend::MokaCacheBuilder;
pub use config::MokaConfig;
pub use core::MokaValue;
-/// Default scheme for moka service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const MOKA_SCHEME: &str = "moka";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_moka_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Moka>(MOKA_SCHEME);
}
diff --git a/core/services/mongodb/src/docs.md b/core/services/mongodb/src/docs.md
index e9af384b1b..c5698374de 100644
--- a/core/services/mongodb/src/docs.md
+++ b/core/services/mongodb/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `connection_string`: Set the connection string of mongodb server
-- `database`: Set the database of mongodb
-- `collection`: Set the collection of mongodb
-- `key_field`: Set the key field of mongodb
-- `value_field`: Set the value field of mongodb
+Use [`crate::MongodbConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/mongodb/src/lib.rs b/core/services/mongodb/src/lib.rs
index ce2411bc0b..e1b50fcf1e 100644
--- a/core/services/mongodb/src/lib.rs
+++ b/core/services/mongodb/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for mongodb service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const MONGODB_SCHEME: &str = "mongodb";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_mongodb_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Mongodb>(MONGODB_SCHEME);
}
diff --git a/core/services/monoiofs/src/docs.md b/core/services/monoiofs/src/docs.md
index 0df9c9767a..b26e50f8f6 100644
--- a/core/services/monoiofs/src/docs.md
+++ b/core/services/monoiofs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,11 +12,14 @@ This service can be used to:
- [x] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work dir for backend.
+## Configuration
-You can refer to [`MonoiofsBuilder`]'s docs for more information
+Use [`crate::MonoiofsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/monoiofs/src/lib.rs b/core/services/monoiofs/src/lib.rs
index b21ddf58b0..b15fd695e2 100644
--- a/core/services/monoiofs/src/lib.rs
+++ b/core/services/monoiofs/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! MonoIOFS service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +30,15 @@ mod writer;
pub use backend::MonoiofsBuilder as Monoiofs;
pub use config::MonoiofsConfig;
-/// Default scheme for monoiofs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const MONOIOFS_SCHEME: &str = "monoiofs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_monoiofs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Monoiofs>(MONOIOFS_SCHEME);
}
diff --git a/core/services/mysql/src/docs.md b/core/services/mysql/src/docs.md
index 0f4ca5cc0d..9e57aac8ef 100644
--- a/core/services/mysql/src/docs.md
+++ b/core/services/mysql/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,13 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `connection_string`: Set the connection string of mysql server
-- `table`: Set the table of mysql
-- `key_field`: Set the key field of mysql
-- `value_field`: Set the value field of mysql
+Use [`crate::MysqlConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/mysql/src/lib.rs b/core/services/mysql/src/lib.rs
index 2e3cdd2e10..ea4f4bdc5d 100644
--- a/core/services/mysql/src/lib.rs
+++ b/core/services/mysql/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for mysql service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const MYSQL_SCHEME: &str = "mysql";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_mysql_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Mysql>(MYSQL_SCHEME);
}
diff --git a/core/services/obs/src/docs.md b/core/services/obs/src/docs.md
index dcfe3c5bfe..bb2760184c 100644
--- a/core/services/obs/src/docs.md
+++ b/core/services/obs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,16 +12,14 @@ This service can be used to:
- [ ] rename
- [x] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `bucket`: Set the container name for backend
-- `endpoint`: Customizable endpoint setting
-- `access_key_id`: Set the access_key_id for backend.
-- `secret_access_key`: Set the secret_access_key for backend.
-- `enable_versioning`: Deprecated. OBS versioning capability is not controlled by this option and this option is no longer needed.
+## Configuration
-You can refer to [`ObsBuilder`]'s docs for more information
+Use [`crate::ObsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/obs/src/lib.rs b/core/services/obs/src/lib.rs
index 7b529c8189..8225e6daa4 100644
--- a/core/services/obs/src/lib.rs
+++ b/core/services/obs/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for obs service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const OBS_SCHEME: &str = "obs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_obs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Obs>(OBS_SCHEME);
}
diff --git a/core/services/onedrive/src/docs.md b/core/services/onedrive/src/docs.md
index 0a4adac28b..9f00fa9f8f 100644
--- a/core/services/onedrive/src/docs.md
+++ b/core/services/onedrive/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,6 +12,9 @@ This service can be used to:
- [x] rename
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Notes
Currently, OpenDAL supports OneDrive Personal only.
@@ -38,16 +41,15 @@ This inconsistency can cause subsequent operations to fail, returning errors lik
- 404 Not Found: OneDrive doesn't recognize the created folder
- 409 Conflict: OneDrive can't replace an existing folder
-You should consider [`RetryLayer`] and monitor your operations carefully.
+Consider using
+[`RetryLayer`](https://docs.rs/opendal-layer-retry/latest/opendal_layer_retry/struct.RetryLayer.html)
+and monitor operations carefully.
## Configuration
-- `access_token`: Set a short-live access token for Microsoft Graph API (also, OneDrive API)
-- `refresh_token`: Set a long term access token for Microsoft Graph API
-- `client_id`: Set the client ID for a Microsoft Graph API application (available though Azure's registration portal)
-- `client_secret`: Set the client secret for a Microsoft Graph API application
-- `root`: Set the work directory for OneDrive backend
-- `enable_versioning`: Deprecated. OneDrive versioning capability is enabled by default and this option is no longer needed.
+Use [`crate::OnedriveConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
The configuration for tokens is one of the following:
@@ -65,8 +67,6 @@ The configuration for tokens is one of the following:
5. Follow the [code grant flow](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow) or other flows to get the access_token. The minimum scope is `Files.ReadWrite`. And make sure the access token represents a user, because it's accessing the user's onedrive by `/me/drive`. So "client credentials flow" won't work.
6. If you need `refresh_token` for long-lived access, add an additional `offline_access` scope.
-Read more at [`OnedriveBuilder`].
-
## Example
### Via Builder
diff --git a/core/services/onedrive/src/lib.rs b/core/services/onedrive/src/lib.rs
index adf83b4c6c..3c8c5055b0 100644
--- a/core/services/onedrive/src/lib.rs
+++ b/core/services/onedrive/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Microsoft OneDrive service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +32,15 @@ mod writer;
pub use backend::OnedriveBuilder as Onedrive;
pub use config::OnedriveConfig;
-/// Default scheme for onedrive service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const ONEDRIVE_SCHEME: &str = "onedrive";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_onedrive_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Onedrive>(ONEDRIVE_SCHEME);
}
diff --git a/core/services/opfs/Cargo.toml b/core/services/opfs/Cargo.toml
index c23710aecb..6dfa2eb68e 100644
--- a/core/services/opfs/Cargo.toml
+++ b/core/services/opfs/Cargo.toml
@@ -30,6 +30,8 @@ version = { workspace = true }
[package.metadata.docs.rs]
all-features = true
+default-target = "wasm32-unknown-unknown"
+targets = ["wasm32-unknown-unknown"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.77"
diff --git a/core/services/opfs/src/docs.md b/core/services/opfs/src/docs.md
index fef5f71f34..7d292c99ea 100644
--- a/core/services/opfs/src/docs.md
+++ b/core/services/opfs/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,6 +12,12 @@ This service can be used to:
- [ ] rename
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
+Use [`crate::OpfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/opfs/src/lib.rs b/core/services/opfs/src/lib.rs
index 3847857179..ce004997ea 100644
--- a/core/services/opfs/src/lib.rs
+++ b/core/services/opfs/src/lib.rs
@@ -16,11 +16,20 @@
// under the License.
#![cfg(target_arch = "wasm32")]
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
-/// Default scheme for opfs service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const OPFS_SCHEME: &str = "opfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_opfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Opfs>(OPFS_SCHEME);
}
diff --git a/core/services/oss/src/docs.md b/core/services/oss/src/docs.md
index 54e6bb903e..f9fc5d96cf 100644
--- a/core/services/oss/src/docs.md
+++ b/core/services/oss/src/docs.md
@@ -1,6 +1,6 @@
-# Capabilities
+## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,30 +12,18 @@ This service can be used to:
- [ ] rename
- [x] presign
-# Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work dir for backend.
-- `bucket`: Set the container name for backend.
-- `endpoint`: Set the endpoint for backend.
-- `addressing_style`: Set the addressing style for endpoint.
-- `presign_endpoint`: Set the endpoint for presign.
-- `presign_addressing_style`: Set the addressing style for presign endpoint.
-- `access_key_id`: Set the access_key_id for backend.
-- `access_key_secret`: Set the access_key_secret for backend.
-- `role_arn`: Set the role of backend.
-- `external_id`: Set the external_id for backend.
-- `oidc_token`: Set the oidc_token for backend.
-- `skip_signature`: Skip loading credentials and signing requests.
-- `allow_anonymous`: Deprecated. Use `skip_signature` instead.
-- `enable_versioning`: Deprecated. OSS versioning capability is enabled by default and this option is no longer needed.
-- `batch_max_operations`: Deprecated. OSS delete batch capability is enabled by default and this option is no longer needed.
-- `delete_max_size`: Deprecated. OSS delete batch capability is enabled by default and this option is no longer needed.
+## Configuration
-Refer to [`OssBuilder`]'s public API docs for more information.
+Use [`crate::OssConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
-# Example
+## Example
-## Via Builder
+### Via Builder
```rust,no_run
use opendal_core::Operator;
diff --git a/core/services/oss/src/lib.rs b/core/services/oss/src/lib.rs
index 1c04475a3d..26e5785577 100644
--- a/core/services/oss/src/lib.rs
+++ b/core/services/oss/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Aliyun Object Storage Service (OSS) implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +31,15 @@ mod writer;
pub use backend::OssBuilder as Oss;
pub use config::OssConfig;
-/// Default scheme for oss service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const OSS_SCHEME: &str = "oss";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_oss_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Oss>(OSS_SCHEME);
}
diff --git a/core/services/pcloud/src/docs.md b/core/services/pcloud/src/docs.md
index 66df576ca4..1cbbbe6480 100644
--- a/core/services/pcloud/src/docs.md
+++ b/core/services/pcloud/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `endpoint`: Pcloud bucket name
-- `username` Pcloud username
-- `password` Pcloud password
+## Configuration
-You can refer to [`PcloudBuilder`]'s docs for more information
+Use [`crate::PcloudConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/pcloud/src/lib.rs b/core/services/pcloud/src/lib.rs
index 45e1bdef7b..b0547e72fd 100644
--- a/core/services/pcloud/src/lib.rs
+++ b/core/services/pcloud/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! pCloud service implementation for Apache OpenDAL.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +31,15 @@ mod writer;
pub use backend::PcloudBuilder as Pcloud;
pub use config::PcloudConfig;
-/// Default scheme for pcloud service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const PCLOUD_SCHEME: &str = "pcloud";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_pcloud_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Pcloud>(PCLOUD_SCHEME);
}
diff --git a/core/services/persy/src/docs.md b/core/services/persy/src/docs.md
index 1d00298a01..c89ada75b5 100644
--- a/core/services/persy/src/docs.md
+++ b/core/services/persy/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,13 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `datafile`: Set the path to the persy data file. The directory in the path must already exist.
-- `segment`: Set the name of the persy segment.
-- `index`: Set the name of the persy index.
+## Configuration
-You can refer to [`PersyBuilder`]'s docs for more information
+Use [`crate::PersyConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/persy/src/lib.rs b/core/services/persy/src/lib.rs
index 962876768b..21c7646b05 100644
--- a/core/services/persy/src/lib.rs
+++ b/core/services/persy/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Persy service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -29,10 +30,15 @@ mod writer;
pub use backend::PersyBuilder as Persy;
pub use config::PersyConfig;
-/// Default scheme for persy service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const PERSY_SCHEME: &str = "persy";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_persy_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Persy>(PERSY_SCHEME);
}
diff --git a/core/services/postgresql/src/docs.md b/core/services/postgresql/src/docs.md
index 1e0faef962..38ba11884d 100644
--- a/core/services/postgresql/src/docs.md
+++ b/core/services/postgresql/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,13 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `connection_string`: Set the connection string of postgres server
-- `table`: Set the table of postgresql
-- `key_field`: Set the key field of postgresql
-- `value_field`: Set the value field of postgresql
+Use [`crate::PostgresqlConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/postgresql/src/lib.rs b/core/services/postgresql/src/lib.rs
index 924e90e1ef..32067a6533 100644
--- a/core/services/postgresql/src/lib.rs
+++ b/core/services/postgresql/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for postgresql service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const POSTGRESQL_SCHEME: &str = "postgresql";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_postgresql_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Postgresql>(POSTGRESQL_SCHEME);
}
diff --git a/core/services/redb/src/docs.md b/core/services/redb/src/docs.md
index 496e823e53..ae4e1f9f4f 100644
--- a/core/services/redb/src/docs.md
+++ b/core/services/redb/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,12 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `datadir`: Set the path to the redb data directory.
-- `table`: Set the table name for Redb.
+## Configuration
-You can refer to [`RedbBuilder`]'s docs for more information.
+Use [`crate::RedbConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/redb/src/lib.rs b/core/services/redb/src/lib.rs
index 03b826aa0a..57f77be7b8 100644
--- a/core/services/redb/src/lib.rs
+++ b/core/services/redb/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Redb service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -29,10 +30,15 @@ mod writer;
pub use backend::RedbBuilder as Redb;
pub use config::RedbConfig;
-/// Default scheme for redb service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const REDB_SCHEME: &str = "redb";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_redb_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Redb>(REDB_SCHEME);
}
diff --git a/core/services/redis/src/docs.md b/core/services/redis/src/docs.md
index e306425838..7cc417d87b 100644
--- a/core/services/redis/src/docs.md
+++ b/core/services/redis/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] ~~create_dir~~
- [x] stat
@@ -12,16 +12,14 @@ This service can be used to:
- [ ] ~~rename~~
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the working directory of `OpenDAL`
-- `endpoint`: Set the network address of redis server
-- `cluster_endpoints`: Set the network address of redis cluster server. This parameter is mutually exclusive with the `endpoint` parameter.
-- `username`: Set the username of Redis
-- `password`: Set the password for authentication
-- `db`: Set the DB of redis
+## Configuration
-You can refer to [`RedisBuilder`]'s docs for more information
+Use [`crate::RedisConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/redis/src/lib.rs b/core/services/redis/src/lib.rs
index 60a9eb3ae4..4dd4842e89 100644
--- a/core/services/redis/src/lib.rs
+++ b/core/services/redis/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Redis service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +30,15 @@ mod writer;
pub use backend::RedisBuilder as Redis;
pub use config::RedisConfig;
-/// Default scheme for redis service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const REDIS_SCHEME: &str = "redis";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_redis_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Redis>(REDIS_SCHEME);
}
diff --git a/core/services/rocksdb/src/docs.md b/core/services/rocksdb/src/docs.md
index 8cfa80c012..e1e7bac755 100644
--- a/core/services/rocksdb/src/docs.md
+++ b/core/services/rocksdb/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,6 +12,9 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Note
OpenDAL will build rocksdb from source by default.
@@ -28,10 +31,9 @@ may be outdated and incompatible.
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `datadir`: Set the path to the rocksdb data directory
-
-You can refer to [`RocksdbBuilder`]'s docs for more information.
+Use [`crate::RocksdbConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/rocksdb/src/lib.rs b/core/services/rocksdb/src/lib.rs
index 9485441ede..06a093db9d 100644
--- a/core/services/rocksdb/src/lib.rs
+++ b/core/services/rocksdb/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for rocksdb service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const ROCKSDB_SCHEME: &str = "rocksdb";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_rocksdb_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Rocksdb>(ROCKSDB_SCHEME);
}
diff --git a/core/services/s3/src/docs.md b/core/services/s3/src/docs.md
index 45788b2d68..66dfe5ab00 100644
--- a/core/services/s3/src/docs.md
+++ b/core/services/s3/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,35 +12,14 @@ This service can be used to:
- [ ] rename
- [x] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the work dir for backend.
-- `bucket`: Set the container name for backend.
-- `endpoint`: Set the endpoint for backend.
-- `region`: Set the region for backend.
-- `access_key_id`: Set the access_key_id for backend.
-- `secret_access_key`: Set the secret_access_key for backend.
-- `session_token`: Set the session_token for backend.
-- `default_storage_class`: Set the default storage_class for backend.
-- `server_side_encryption`: Set the server_side_encryption for backend.
-- `server_side_encryption_aws_kms_key_id`: Set the server_side_encryption_aws_kms_key_id for backend.
-- `server_side_encryption_customer_algorithm`: Set the server_side_encryption_customer_algorithm for backend.
-- `server_side_encryption_customer_key`: Set the server_side_encryption_customer_key for backend.
-- `server_side_encryption_customer_key_md5`: Set the server_side_encryption_customer_key_md5 for backend.
-- `disable_config_load`: Disable aws config load from env.
-- `enable_virtual_host_style`: Enable virtual host style.
-- `enable_request_payer`: Enable the request payer for backend.
-- `skip_signature`: Skip loading credentials and signing requests.
-- `allow_anonymous`: Deprecated. Use `skip_signature` instead.
-- `batch_max_operations`: Deprecated. S3 delete batch capability is enabled by default and this option is no longer needed.
-- `delete_max_size`: Deprecated. S3 delete batch capability is enabled by default and this option is no longer needed.
-- `disable_stat_with_override`: Deprecated. S3 stat override capabilities are enabled by default and this option is no longer needed.
-- `disable_write_with_if_match`: Deprecated. S3 write with If-Match capability is enabled by default and this option is no longer needed.
-- `enable_versioning`: Deprecated. S3 versioning capability is enabled by default and this option is no longer needed.
-- `enable_write_with_append`: Deprecated. S3 append capability is enabled by default and this option is no longer needed.
-- `default_acl`: Define the default access control list (ACL) when creating a new object. Note that some s3 services like minio do not support this option.
-
-Refer to [`S3Builder`]'s public API docs for more information.
+Use [`crate::S3Config`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Temporary security credentials
diff --git a/core/services/s3/src/lib.rs b/core/services/s3/src/lib.rs
index 9c0603a0bf..8e34b7dd12 100644
--- a/core/services/s3/src/lib.rs
+++ b/core/services/s3/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Amazon S3 service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +32,15 @@ mod writer;
pub use backend::S3Builder as S3;
pub use config::S3Config;
-/// Default scheme for s3 service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const S3_SCHEME: &str = "s3";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_s3_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<S3>(S3_SCHEME);
}
diff --git a/core/services/seafile/src/docs.md b/core/services/seafile/src/docs.md
index c0c2ac6dcf..1d21297b1e 100644
--- a/core/services/seafile/src/docs.md
+++ b/core/services/seafile/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,15 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `endpoint`: Seafile endpoint address
-- `username` Seafile username
-- `password` Seafile password
-- `repo_name` Seafile repo name
+## Configuration
-You can refer to [`SeafileBuilder`]'s docs for more information
+Use [`crate::SeafileConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/seafile/src/lib.rs b/core/services/seafile/src/lib.rs
index 14b7272a2c..e61b3363ba 100644
--- a/core/services/seafile/src/lib.rs
+++ b/core/services/seafile/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for seafile service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const SEAFILE_SCHEME: &str = "seafile";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_seafile_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Seafile>(SEAFILE_SCHEME);
}
diff --git a/core/services/sftp/src/docs.md b/core/services/sftp/src/docs.md
index c7ed0a62fd..3ef264241a 100644
--- a/core/services/sftp/src/docs.md
+++ b/core/services/sftp/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,19 +12,17 @@ This service can be used to:
- [x] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `endpoint`: Set the endpoint for connection. The format is same as `openssh`, using either `[user@]hostname` or `ssh://[user@]hostname[:port]`. A username or port that is specified in the endpoint overrides the one set in the builder (but does not change the builder).
-- `root`: Set the work directory for backend. It uses the default directory set by the remote `sftp-server` as default
-- `user`: Set the login user
-- `key`: Set the file path to the private key for authentication
-- `known_hosts_strategy`: Set the strategy for known hosts, default to `Strict`
-- `enable_copy`: Deprecated. SFTP copy capability is enabled by default and this option is no longer needed.
+Use [`crate::SftpConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
For security reasons, it doesn't support password login. Use SSH key-based authentication (e.g., configure your public key on the server via `ssh-copy-id` and provide the private key here).
-You can refer to [`SftpBuilder`]'s docs for more information
-
## Example
### Via Builder
diff --git a/core/services/sftp/src/lib.rs b/core/services/sftp/src/lib.rs
index ebbc61b8f4..1cb8bb2af4 100644
--- a/core/services/sftp/src/lib.rs
+++ b/core/services/sftp/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! SFTP service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::SftpBuilder as Sftp;
pub use config::SftpConfig;
-/// Default scheme for sftp service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const SFTP_SCHEME: &str = "sftp";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_sftp_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Sftp>(SFTP_SCHEME);
}
diff --git a/core/services/sled/src/docs.md b/core/services/sled/src/docs.md
index 82e4ab5e01..3cf8948433 100644
--- a/core/services/sled/src/docs.md
+++ b/core/services/sled/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,11 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `datadir`: Set the path to the sled data directory
+## Configuration
-You can refer to [`SledBuilder`]'s docs for more information
+Use [`crate::SledConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/sled/src/lib.rs b/core/services/sled/src/lib.rs
index 35f4982a1a..ce7d3e3eb8 100644
--- a/core/services/sled/src/lib.rs
+++ b/core/services/sled/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for sled service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const SLED_SCHEME: &str = "sled";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_sled_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Sled>(SLED_SCHEME);
}
diff --git a/core/services/sqlite/src/docs.md b/core/services/sqlite/src/docs.md
index fb7f5f0153..48bbf99273 100644
--- a/core/services/sqlite/src/docs.md
+++ b/core/services/sqlite/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,13 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `connection_string`: Set the connection string of sqlite database
-- `table`: Set the table of sqlite
-- `key_field`: Set the key field of sqlite
-- `value_field`: Set the value field of sqlite
+Use [`crate::SqliteConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/sqlite/src/lib.rs b/core/services/sqlite/src/lib.rs
index 270220a518..20cfbcfe3b 100644
--- a/core/services/sqlite/src/lib.rs
+++ b/core/services/sqlite/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for sqlite service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const SQLITE_SCHEME: &str = "sqlite";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_sqlite_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Sqlite>(SQLITE_SCHEME);
}
diff --git a/core/services/surrealdb/src/docs.md b/core/services/surrealdb/src/docs.md
index 473ee7ef39..356eb6182f 100644
--- a/core/services/surrealdb/src/docs.md
+++ b/core/services/surrealdb/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,17 +12,15 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Configuration
-- `root`: Set the working directory of `OpenDAL`
-- `connection_string`: Set the connection string of surrealdb server
-- `username`: set the username of surrealdb
-- `password`: set the password of surrealdb
-- `namespace`: set the namespace of surrealdb
-- `database`: set the database of surrealdb
-- `table`: Set the table of surrealdb
-- `key_field`: Set the key field of surrealdb
-- `value_field`: Set the value field of surrealdb
+Use [`crate::SurrealdbConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
+
-
## Example
diff --git a/core/services/surrealdb/src/lib.rs b/core/services/surrealdb/src/lib.rs
index 11d7a66b6b..102949e179 100644
--- a/core/services/surrealdb/src/lib.rs
+++ b/core/services/surrealdb/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Surrealdb service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -29,10 +30,15 @@ mod writer;
pub use backend::SurrealdbBuilder as Surrealdb;
pub use config::SurrealdbConfig;
-/// Default scheme for surrealdb service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const SURREALDB_SCHEME: &str = "surrealdb";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_surrealdb_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Surrealdb>(SURREALDB_SCHEME);
}
diff --git a/core/services/swift/src/docs.md b/core/services/swift/src/docs.md
index e94343bfa3..8d0483ffaf 100644
--- a/core/services/swift/src/docs.md
+++ b/core/services/swift/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,13 +12,14 @@ This service can be used to:
- [ ] ~~rename~~
- [ ] ~~presign~~
-## Configurations
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `endpoint`: Set the endpoint for backend.
-- `container`: Swift container.
-- `token`: Swift personal access token.
+## Configuration
-Refer to [`SwiftBuilder`]'s public API docs for more information.
+Use [`crate::SwiftConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Examples
diff --git a/core/services/swift/src/lib.rs b/core/services/swift/src/lib.rs
index 2b98ac568e..26dd90a9eb 100644
--- a/core/services/swift/src/lib.rs
+++ b/core/services/swift/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Swift service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::SwiftBuilder as Swift;
pub use config::SwiftConfig;
-/// Default scheme for swift service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const SWIFT_SCHEME: &str = "swift";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_swift_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Swift>(SWIFT_SCHEME);
}
diff --git a/core/services/tikv/src/docs.md b/core/services/tikv/src/docs.md
index 0c05a0a015..b9941cba64 100644
--- a/core/services/tikv/src/docs.md
+++ b/core/services/tikv/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,15 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `endpoints`: Set the endpoints to the tikv cluster
-- `insecure`: Set the insecure flag to the tikv cluster
-- `ca_path`: Set the ca path to the tikv connection
-- `cert_path`: Set the cert path to the tikv connection
-- `key_path`: Set the key path to the tikv connection
+## Configuration
-You can refer to [`TikvBuilder`]'s docs for more information
+Use [`crate::TikvConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/tikv/src/lib.rs b/core/services/tikv/src/lib.rs
index bb71b33652..db8191d089 100644
--- a/core/services/tikv/src/lib.rs
+++ b/core/services/tikv/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for tikv service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const TIKV_SCHEME: &str = "tikv";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_tikv_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Tikv>(TIKV_SCHEME);
}
diff --git a/core/services/tos/src/docs.md b/core/services/tos/src/docs.md
index 9a3711faf6..01610d88ce 100644
--- a/core/services/tos/src/docs.md
+++ b/core/services/tos/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,17 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend.
-- `bucket`: Set the bucket name for backend.
-- `endpoint`: Set the endpoint for backend.
-- `region`: Set the region for backend.
-- `access_key_id`: Set the access_key_id for backend.
-- `secret_access_key`: Set the secret_access_key for backend.
-- `security_token`: Set the security token for backend.
+## Configuration
-Refer to [`TosBuilder`]'s public API docs for more information.
+Use [`crate::TosConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/tos/src/lib.rs b/core/services/tos/src/lib.rs
index 15f74d2427..262c1d09da 100644
--- a/core/services/tos/src/lib.rs
+++ b/core/services/tos/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Volcengine TOS service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +32,15 @@ mod writer;
pub use backend::TosBuilder as Tos;
pub use config::TosConfig;
-/// Default scheme for TOS service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const TOS_SCHEME: &str = "tos";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_tos_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Tos>(TOS_SCHEME);
}
diff --git a/core/services/upyun/src/docs.md b/core/services/upyun/src/docs.md
index de278e38df..20319b644f 100644
--- a/core/services/upyun/src/docs.md
+++ b/core/services/upyun/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `bucket`: Upyun bucket name
-- `operator` Upyun operator
-- `password` Upyun password
+## Configuration
-You can refer to [`UpyunBuilder`]'s docs for more information
+Use [`crate::UpyunConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/upyun/src/lib.rs b/core/services/upyun/src/lib.rs
index 1948e3fec8..e22c4d3ab8 100644
--- a/core/services/upyun/src/lib.rs
+++ b/core/services/upyun/src/lib.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Upyun service implementation for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -31,10 +31,15 @@ mod writer;
pub use backend::UpyunBuilder as Upyun;
pub use config::UpyunConfig;
-/// Default scheme for upyun service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const UPYUN_SCHEME: &str = "upyun";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_upyun_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Upyun>(UPYUN_SCHEME);
}
diff --git a/core/services/vercel-artifacts/src/docs.md b/core/services/vercel-artifacts/src/docs.md
index 9a359a3fa6..8506ef76a3 100644
--- a/core/services/vercel-artifacts/src/docs.md
+++ b/core/services/vercel-artifacts/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,14 +12,14 @@ This service can be used to:
- [ ] ~~rename~~
- [ ] ~~presign~~
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `access_token`: set the access_token for Rest API
-- `endpoint`: set the API endpoint (default: `https://api.vercel.com`)
-- `team_id`: optional Vercel team ID, appended as `teamId` query parameter
-- `team_slug`: optional Vercel team slug, appended as `slug` query parameter
+## Configuration
-You can refer to [`VercelArtifactsBuilder`]'s docs for more information
+Use [`crate::VercelArtifactsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/vercel-artifacts/src/lib.rs b/core/services/vercel-artifacts/src/lib.rs
index 88503ccfec..d37bd796d6 100644
--- a/core/services/vercel-artifacts/src/lib.rs
+++ b/core/services/vercel-artifacts/src/lib.rs
@@ -15,12 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-//! Vercel Artifacts service support for OpenDAL.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
-/// Default scheme for vercel-artifacts service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const VERCEL_ARTIFACTS_SCHEME: &str = "vercel-artifacts";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_vercel_artifacts_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<VercelArtifacts>(VERCEL_ARTIFACTS_SCHEME);
}
diff --git a/core/services/vercel-blob/src/docs.md b/core/services/vercel-blob/src/docs.md
index 3cecf10759..392679c450 100644
--- a/core/services/vercel-blob/src/docs.md
+++ b/core/services/vercel-blob/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [ ] create_dir
- [x] stat
@@ -12,12 +12,14 @@ This service can be used to:
- [ ] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `token`: VercelBlob token, environment var `BLOB_READ_WRITE_TOKEN`
+## Configuration
-You can refer to [`VercelBlobBuilder`]'s docs for more information
+Use [`crate::VercelBlobConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/vercel-blob/src/lib.rs b/core/services/vercel-blob/src/lib.rs
index e0d4f14209..95f30cae27 100644
--- a/core/services/vercel-blob/src/lib.rs
+++ b/core/services/vercel-blob/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for vercel-blob service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const VERCEL_BLOB_SCHEME: &str = "vercel-blob";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_vercel_blob_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<VercelBlob>(VERCEL_BLOB_SCHEME);
}
diff --git a/core/services/webdav/src/docs.md b/core/services/webdav/src/docs.md
index 470a8abfbd..7c907e6a4e 100644
--- a/core/services/webdav/src/docs.md
+++ b/core/services/webdav/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,6 +12,9 @@ This service can be used to:
- [x] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Notes
Bazel Remote Caching and Ccache HTTP Storage is also part of this service.
@@ -19,12 +22,9 @@ Users can use `webdav` to connect those services.
## Configuration
-- `endpoint`: set the endpoint for webdav
-- `root`: Set the work directory for backend
-- `disable_copy`: Deprecated. WebDAV copy capability is enabled by default and this option is no longer needed.
-- `enable_user_metadata`: Deprecated. WebDAV user metadata capability is enabled by default. Use `CapabilityOverrideLayer` to override `write_with_user_metadata` for endpoints without PROPPATCH support.
-
-You can refer to [`WebdavBuilder`]'s docs for more information
+Use [`crate::WebdavConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/webdav/src/lib.rs b/core/services/webdav/src/lib.rs
index 9a5e98edaa..930ef727a5 100644
--- a/core/services/webdav/src/lib.rs
+++ b/core/services/webdav/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for webdav service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const WEBDAV_SCHEME: &str = "webdav";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_webdav_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Webdav>(WEBDAV_SCHEME);
}
diff --git a/core/services/webhdfs/src/docs.md b/core/services/webhdfs/src/docs.md
index ffa2ed9894..5afb821a73 100644
--- a/core/services/webhdfs/src/docs.md
+++ b/core/services/webhdfs/src/docs.md
@@ -5,7 +5,7 @@ There two implementations of WebHDFS REST API:
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -17,9 +17,14 @@ This service can be used to:
- [ ] rename
- [ ] ~~presign~~
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
+
## Differences with HDFS
-[Hdfs][crate::services::Hdfs] is powered by HDFS's native java client. Users need to set up the HDFS services correctly. But webhdfs can access from HTTP API and no extra setup needed.
+The [HDFS service](https://docs.rs/opendal-service-hdfs) uses HDFS's native
+Java client and requires a working Java and Hadoop environment. WebHDFS uses
+the HTTP API instead.
## WebHDFS Compatibility Guidelines
@@ -41,14 +46,11 @@ This issue, identified as [HDFS-6641](https://issues.apache.org/jira/browse/HDFS
In summary, OpenDAL WebHDFS is designed for optimal compatibility with HDFS, specifically versions 2.9 and later.
-## Configurations
-
-- `root`: The root path of the WebHDFS service.
-- `endpoint`: The endpoint of the WebHDFS service.
-- `delegation`: The delegation token for WebHDFS.
-- `atomic_write_dir`: The tmp write dir of multi write for WebHDFS.Needs to be configured for multi write support.
+## Configuration
-Refer to [`Builder`]'s public API docs for more information.
+Use [`crate::WebhdfsConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Examples
diff --git a/core/services/webhdfs/src/lib.rs b/core/services/webhdfs/src/lib.rs
index 9853ce4b54..6486471826 100644
--- a/core/services/webhdfs/src/lib.rs
+++ b/core/services/webhdfs/src/lib.rs
@@ -15,10 +15,20 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for webhdfs service.
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
+
+/// URI scheme used for service registration and scheme-driven construction.
pub const WEBHDFS_SCHEME: &str = "webhdfs";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_webhdfs_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<Webhdfs>(WEBHDFS_SCHEME);
}
diff --git a/core/services/yandex-disk/src/docs.md b/core/services/yandex-disk/src/docs.md
index 3d51e84963..62c90dec83 100644
--- a/core/services/yandex-disk/src/docs.md
+++ b/core/services/yandex-disk/src/docs.md
@@ -1,6 +1,6 @@
## Capabilities
-This service can be used to:
+Depending on its configuration and the backing system, this service can expose:
- [x] create_dir
- [x] stat
@@ -12,12 +12,14 @@ This service can be used to:
- [x] rename
- [ ] presign
-## Configuration
+Inspect the effective capability set with [`opendal_core::Operator::info`] and
+[`opendal_core::OperatorInfo::capability`] after building an operator.
-- `root`: Set the work directory for backend
-- `access_token` YandexDisk oauth access_token
+## Configuration
-You can refer to [`YandexDiskBuilder`]'s docs for more information
+Use [`crate::YandexDiskConfig`] for serializable configuration and this builder's
+methods for direct construction. The field and method documentation defines
+accepted values, defaults, and environment interaction.
## Example
diff --git a/core/services/yandex-disk/src/lib.rs b/core/services/yandex-disk/src/lib.rs
index 2cd1a7bedf..02a1734c7d 100644
--- a/core/services/yandex-disk/src/lib.rs
+++ b/core/services/yandex-disk/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Yandex Disk service implementation for Apache OpenDAL.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
mod backend;
@@ -30,10 +31,15 @@ mod writer;
pub use backend::YandexDiskBuilder as YandexDisk;
pub use config::YandexDiskConfig;
-/// Default scheme for yandex-disk service.
+/// URI scheme used for service registration and scheme-driven construction.
pub const YANDEX_DISK_SCHEME: &str = "yandex-disk";
-/// Register this service into the given registry.
+/// Register this service's URI scheme or schemes with an operator registry.
+///
+/// Registration enables scheme-driven construction through
+/// [`opendal_core::Operator::from_uri`] and
+/// [`opendal_core::Operator::via_iter`]. Direct construction through
+/// [`opendal_core::Operator::new`] does not require registration.
pub fn register_yandex_disk_service(registry: &opendal_core::OperatorRegistry) {
registry.register::<YandexDisk>(YANDEX_DISK_SCHEME);
}
diff --git a/core/src/lib.rs b/core/src/lib.rs
index 8e4a5cfecf..197bf54f53 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -18,8 +18,9 @@
#![doc(
html_logo_url = "https://raw.githubusercontent.com/apache/opendal/main/website/static/img/logo.svg"
)]
+#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
-//! Facade crate that re-exports all public APIs from `opendal-core` and optional services/layers.
+#![cfg_attr(docsrs, doc(auto_cfg))]
#![deny(missing_docs)]
pub use opendal_core::*;
@@ -269,7 +270,15 @@ fn register_default_operator_registry() {
install_default();
}
-/// Re-export of service implementations.
+/// Service builders enabled through `services-*` Cargo features.
+///
+/// [`Memory`](services::Memory) is always available. Other builders are
+/// re-exported when their matching facade feature is enabled; for example,
+/// `services-s3` enables [`S3`](services::S3).
+///
+/// Pass a configured builder to [`Operator::new`]. The facade automatically
+/// registers enabled services for [`Operator::from_uri`] and
+/// [`Operator::via_iter`] when the `auto-register-services` feature is enabled.
pub mod services {
pub use opendal_core::services::*;
#[cfg(feature = "services-aliyun-drive")]
@@ -402,7 +411,12 @@ pub mod services {
pub use opendal_service_yandex_disk::*;
}
-/// Re-export of layers.
+/// Layers enabled through `layers-*` Cargo features.
+///
+/// A layer adds cross-service behavior to an [`Operator`]. Enable the matching
+/// facade feature, construct the layer, and pass it to [`Operator::layer`].
+/// Layer order is observable, so review each layer's composition notes when
+/// combining retries, timeouts, caching, or observability.
pub mod layers {
pub use opendal_core::layers::*;
#[cfg(feature = "layers-async-backtrace")]
diff --git a/core/testkit/src/lib.rs b/core/testkit/src/lib.rs
index bb2295ec1d..d18051f438 100644
--- a/core/testkit/src/lib.rs
+++ b/core/testkit/src/lib.rs
@@ -15,8 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-//! Test harness and utilities for Apache OpenDAL.
-
+#![doc = include_str!("../README.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, doc(auto_cfg))]
+#![deny(missing_docs)]
mod read;
pub use read::ReadAction;
pub use read::ReadChecker;
diff --git a/core/testkit/src/read.rs b/core/testkit/src/read.rs
index 1d82d9bd3d..2045b942ac 100644
--- a/core/testkit/src/read.rs
+++ b/core/testkit/src/read.rs
@@ -22,28 +22,27 @@ use rand::rng;
use crate::utils::sha256_digest;
-/// ReadAction represents a read action.
+/// A reader operation executed by [`ReadChecker`].
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum ReadAction {
- /// Read represents a read action with given input buf size.
+ /// Read `size` bytes beginning at `offset`.
///
- /// # NOTE
- ///
- /// The size is the input buf size, it's possible that the actual read size is smaller.
+ /// The first field is the offset and the second field is the requested
+ /// size. A reader can return fewer bytes at the end of an object.
Read(usize, usize),
}
-/// ReadChecker is used to check the correctness of the read process.
+/// Generates reference data and verifies reads against it.
pub struct ReadChecker {
- /// Raw Data is the data we write to the storage.
+ /// Data that callers write to the storage before checking reads.
raw_data: Bytes,
}
impl ReadChecker {
- /// Create a new read checker by given size and range.
+ /// Create a checker containing `size` bytes of random reference data.
///
- /// It's by design that we use a random generator to generate the raw data. The content of data
- /// is not important, we only care about the correctness of the read process.
+ /// Random input makes the checker sensitive to misplaced or repeated data;
+ /// callers should not depend on the generated content.
pub fn new(size: usize) -> Self {
let mut rng = rng();
let mut data = vec![0; size];
@@ -54,7 +53,7 @@ impl ReadChecker {
Self { raw_data }
}
- /// Return the raw data of this read checker.
+ /// Return the reference data that should be written before a check.
pub fn data(&self) -> Bytes {
self.raw_data.clone()
}
@@ -100,9 +99,9 @@ impl ReadChecker {
}
}
- /// Check will check the correctness of the read process via given actions.
+ /// Execute `actions` and verify each result against the reference data.
///
- /// Check will panic if any check failed.
+ /// This method panics if a read fails or returns incorrect data.
pub async fn check(&mut self, r: Reader, actions: &[ReadAction]) {
for action in actions {
match *action {
diff --git a/core/testkit/src/write.rs b/core/testkit/src/write.rs
index c81db68e35..9110b6d10e 100644
--- a/core/testkit/src/write.rs
+++ b/core/testkit/src/write.rs
@@ -22,32 +22,31 @@ use rand::rng;
use crate::utils::sha256_digest;
-/// WriteAction represents a read action.
+/// A writer operation used by write behavior tests.
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum WriteAction {
- /// Write represents a write action with given input buf size.
+ /// Write a buffer with the given size.
///
- /// # NOTE
- ///
- /// The size is the input buf size, it's possible that the actual write size is smaller.
+ /// A writer can accept the buffer incrementally even though the action
+ /// supplies it as one logical chunk.
Write(usize),
}
-/// WriteAction is used to check the correctness of the write process.
+/// Generates write chunks and verifies the combined stored data.
pub struct WriteChecker {
chunks: Vec<Bytes>,
data: Bytes,
}
impl WriteChecker {
- /// Create a new WriteChecker with given size.
- pub fn new(size: Vec<usize>) -> Self {
+ /// Create random chunks with the requested `sizes`.
+ pub fn new(sizes: Vec<usize>) -> Self {
let mut rng = rng();
- let mut chunks = Vec::with_capacity(size.len());
+ let mut chunks = Vec::with_capacity(sizes.len());
- for i in size {
- let mut bs = vec![0u8; i];
+ for size in sizes {
+ let mut bs = vec![0u8; size];
rng.fill_bytes(&mut bs);
chunks.push(Bytes::from(bs));
}
@@ -63,12 +62,12 @@ impl WriteChecker {
}
}
- /// Get the check's chunks.
+ /// Return the chunks to write, in order.
pub fn chunks(&self) -> &[Bytes] {
&self.chunks
}
- /// Check the correctness of the write process.
+ /// Verify that `actual` equals the concatenated generated chunks.
pub fn check(&self, actual: &[u8]) {
if actual != self.data.as_ref() {
assert_eq!(