Skip to content

docs #396: expand Client API docs, fix intra-doc links, improve quick-start guides - #397

Merged
JoshuaChi merged 3 commits into
mainfrom
doc/396-client-apis
May 27, 2026
Merged

JoshuaChi merged 3 commits into
mainfrom
doc/396-client-apis

Conversation

@JoshuaChi

@JoshuaChi JoshuaChi commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

What Does This PR Do?

Adds a complete "Client API at a Glance" table to the docs landing page, fixes all
intra-doc link warnings, and improves both quick-start guides with clearer entry points
and working examples.

Type:

  • Bug Fix (with test)
  • Feature (issue #___ approved)
  • Documentation
  • Test/Coverage
  • Performance (with benchmark)

Why Is This Needed?

Developers couldn't discover d-engine's client API without reading source code — the
docs landing page lacked a complete method table and clear entry points for both
EmbeddedClient and GrpcClient. The standalone quick-start had no Rust example.
The config/base/ directory had no explanation, causing confusion about whether
the base/overlays pattern was intended for production use (it is not).


Checklist

Required:

  • make test passes
  • Added tests for new code — N/A (docs only)
  • Commits squashed to 1-2 logical units

If changing APIs:

  • Updated relevant docs — this PR IS the docs update

Testing

How tested:

  • cargo doc --features "client,server,rocksdb,watch" — zero warnings
  • Manual review of rendered target/doc/d_engine/index.html

Does This Follow d-engine's Principles?

  • Solves a real problem for most users (not just my edge case)
  • Keeps implementation simple
  • Doesn't bloat the API surface

Reviewer Notes

Documentation-only PR — no logic changes. Key changes:

  • overview.md: all client methods now visible on landing page; EmbeddedClient and
    GrpcClient linked to their respective doc pages; Quick Start uses start() (no config file required)
  • quick-start-standalone.md: added Rust ClientBuilder example
  • quick-start-5min.md: removed out-of-place performance table; config step now links
    to d_engine_core::config for all options
  • config/base/README.md: new file clarifying this directory is for internal demo only
  • d-engine-core/src/config/security.rs: deleted empty placeholder file

Estimated review complexity:

  • Quick (< 100 lines)
  • Medium (< 300 lines)
  • Deep (> 300 lines)

Summary by CodeRabbit

  • Documentation

    • Added a "New to d-engine? 5-minute guide" link and revised Quick Start content.
    • Reworked overview with a "Recommended Entry Point" and updated embedded quick-start example.
    • Expanded quick-start guides with clearer config guidance and a new Rust client example for standalone mode.
    • Clarified client API docs and usage mapping for available client types.
  • Chores

    • Added a configuration reference guide and documented the unified storage option.
    • Disabled crate doctest execution for the re-export wrapper.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb40dd34-b92b-4bc7-bd6c-1411b07eff1b

📥 Commits

Reviewing files that changed from the base of the PR and between 64b5aeb and 23920ba.

📒 Files selected for processing (3)
  • d-engine/Cargo.toml
  • d-engine/src/docs/overview.md
  • d-engine/src/docs/quick-start-standalone.md
✅ Files skipped from review due to trivial changes (2)
  • d-engine/src/docs/quick-start-standalone.md
  • d-engine/src/docs/overview.md

📝 Walkthrough

Walkthrough

This PR refreshes d-engine's user-facing documentation and configuration guidance. It clarifies the two client modes (embedded and standalone gRPC), adds configuration reference materials, revamps the overview with entry-point guidance and Client API tables, enhances quick-start guides with examples (including a Rust client), and disables doctests in the crate lib config.

Changes

Documentation and Configuration Guidance Overhaul

Layer / File(s) Summary
Client interface clarification across modes
d-engine-client/src/grpc_client.rs, d-engine-core/src/client/client_api.rs, d-engine-server/src/api/embedded_client.rs
Documentation updates to GrpcClient, EmbeddedClient, and ClientApi trait clarify the two client modes: embedded mode via EmbeddedEngine::client(), standalone gRPC mode via ClientBuilder, and consistency behaviors (linearizable writes, get_linearizable/get_eventual reads).
Configuration documentation and examples
config/base/README.md, config/base/storage.toml
New configuration README explains d-engine.toml authoring, provides minimal/single-node/cluster examples, and maps reference files to their coverage. storage.toml example shows unified_db setting and single-vs-dual RocksDB instance tradeoff.
Overview documentation with entry point and Client API reference
d-engine/src/docs/overview.md
Rewrote overview with "Recommended Entry Point" dependency snippet and updated embedded example using EmbeddedEngine::start(). Added "Client API" section with method tables for write/read/watch/cluster operations mapped to client types and builders. Removed trailing License section.
Enhanced quick-start guides with client examples
README.md, d-engine/src/docs/quick-start-5min.md, d-engine/src/docs/quick-start-standalone.md
README updated with quick-link to 5-minute guide. quick-start-5min.md adds Tokio feature explanation, clarifies config usage, removes performance table, and renames a pattern. quick-start-standalone.md adds a Rust client section with ClientBuilder example, put/get_linearizable operations, and endpoint-based leader redirect behavior.
Crate lib doctest disabled
d-engine/Cargo.toml
Added a [lib] configuration block disabling doctests for the d-engine crate with comments indicating the crate is a re-export wrapper and examples are used for compilation verification.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 A rabbit hops through docs so bright,
Two client modes—embedded and gRPC light,
Config guides and quick-start ways,
Clearer paths through d-engine's maze! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main changes: expanding Client API documentation, fixing intra-doc links, and improving quick-start guides, which aligns with the file summaries and PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch doc/396-client-apis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
d-engine-server/src/api/embedded_client.rs (1)

117-119: ⚡ Quick win

Complete the intra-doc link syntax.

The doc references use plain backticks. For consistency with the PR's goal to fix intra-doc link warnings and to enable clickable navigation, these should use proper rustdoc link syntax.

📖 Proposed fix
-/// Zero-overhead KV client for embedded mode. Obtained via `EmbeddedEngine::client()`.
+/// Zero-overhead KV client for embedded mode. Obtained via [`EmbeddedEngine::client()`].
 ///
-/// For standalone/gRPC mode use `GrpcClient` instead. Both implement `ClientApi`.
+/// For standalone/gRPC mode use [`GrpcClient`] instead. Both implement [`ClientApi`].

Note: Verify the correct cross-crate paths for EmbeddedEngine (likely d_engine::EmbeddedEngine) and GrpcClient (likely in d_engine_client).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@d-engine-server/src/api/embedded_client.rs` around lines 117 - 119, Update
the doc comment to use Rust intra-doc link syntax instead of plain backticks:
replace `EmbeddedEngine`, `GrpcClient`, and `ClientApi` with proper links like
[`EmbeddedEngine`] and [`GrpcClient`] (or fully-qualified paths such as
[`d_engine::EmbeddedEngine`] and [`d_engine_client::GrpcClient`] if needed) so
the references become clickable and resolve across crates; ensure the link
targets match the actual crate paths and keep the explanatory text unchanged.
d-engine-client/src/grpc_client.rs (1)

33-35: ⚡ Quick win

Complete the intra-doc link syntax.

The doc references to ClientBuilder, EmbeddedClient, and ClientApi use plain backticks. Since the PR objectives mention "fixes intra-documentation link warnings," these should use proper rustdoc link syntax for clickability and to eliminate warnings.

📖 Proposed fix
-/// gRPC-based KV client for standalone mode. Obtained via [`crate::ClientBuilder`].
+/// gRPC-based KV client for standalone mode. Obtained via [`crate::ClientBuilder`](crate::ClientBuilder).
 ///
-/// For embedded mode use `EmbeddedClient` instead. Both implement `ClientApi`.
+/// For embedded mode use `EmbeddedClient` instead. Both implement [`ClientApi`](d_engine_core::client::ClientApi).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@d-engine-client/src/grpc_client.rs` around lines 33 - 35, The module
docstring uses plain backticks for intra-doc references and must be converted to
rustdoc link syntax: replace `ClientBuilder`, `EmbeddedClient`, and `ClientApi`
in the comment with their intra-doc links (e.g., [`ClientBuilder`],
[`EmbeddedClient`], and [`ClientApi`]) so rustdoc generates clickable links and
removes the intra-doc warnings; ensure the bracketed links match the exact item
names/signatures used in the crate.
d-engine-core/src/client/client_api.rs (1)

33-38: ⚡ Quick win

Complete the intra-doc link syntax.

The doc references to EmbeddedClient, GrpcClient, engine.client(), and ClientBuilder use plain backticks. For consistency with the PR's goal to fix intra-doc link warnings and to enable clickable navigation in rendered docs, these should use proper rustdoc link syntax.

📖 Proposed fix
-/// Unified key-value store interface implemented by `EmbeddedClient` and `GrpcClient`.
+/// Unified key-value store interface implemented by [`EmbeddedClient`] and [`GrpcClient`].
 ///
-/// You do **not** need to import or name this trait directly — use the concrete client type
-/// returned by `engine.client()` or `ClientBuilder` and call methods on it.
+/// You do **not** need to import or name this trait directly — use the concrete client type  
+/// returned by [`EmbeddedEngine::client()`] or [`ClientBuilder`] and call methods on it.
 ///
 /// Only import `ClientApi` when writing generic code over both client types.

Note: You'll need to verify the correct paths for the cross-crate links (EmbeddedClient is in d-engine-server, GrpcClient is in d-engine-client, EmbeddedEngine and ClientBuilder are likely in d-engine).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@d-engine-core/src/client/client_api.rs` around lines 33 - 38, Update the doc
comment on the ClientApi trait to use rustdoc intra-doc links instead of plain
backticks: replace `EmbeddedClient`, `GrpcClient`, `engine.client()`, and
`ClientBuilder` with their intra-doc link forms (e.g. [EmbeddedClient],
[GrpcClient], [`engine::client()`] or the correct method path, and
[ClientBuilder]) so the docs become clickable; ensure you use the correct crate
paths for cross-crate links (EmbeddedClient in d-engine-server, GrpcClient in
d-engine-client, and the appropriate paths for engine.client() and
ClientBuilder) and keep the surrounding explanatory text unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@d-engine/src/docs/overview.md`:
- Around line 64-74: The doc entry for EmbeddedClient::get_lease is incorrect:
it currently says "TTL remaining for a key" but get_lease is a lease-based
linearizable read consistency method; update the description in the Read table
to reflect that it is a lease-based/lease-backed linearizable read policy (or
"Lease-based linearizable read" / "Read using lease-based linearizable
consistency") so it matches the ClientApi trait and contextual snippets
referencing get_lease.

---

Nitpick comments:
In `@d-engine-client/src/grpc_client.rs`:
- Around line 33-35: The module docstring uses plain backticks for intra-doc
references and must be converted to rustdoc link syntax: replace
`ClientBuilder`, `EmbeddedClient`, and `ClientApi` in the comment with their
intra-doc links (e.g., [`ClientBuilder`], [`EmbeddedClient`], and [`ClientApi`])
so rustdoc generates clickable links and removes the intra-doc warnings; ensure
the bracketed links match the exact item names/signatures used in the crate.

In `@d-engine-core/src/client/client_api.rs`:
- Around line 33-38: Update the doc comment on the ClientApi trait to use
rustdoc intra-doc links instead of plain backticks: replace `EmbeddedClient`,
`GrpcClient`, `engine.client()`, and `ClientBuilder` with their intra-doc link
forms (e.g. [EmbeddedClient], [GrpcClient], [`engine::client()`] or the correct
method path, and [ClientBuilder]) so the docs become clickable; ensure you use
the correct crate paths for cross-crate links (EmbeddedClient in
d-engine-server, GrpcClient in d-engine-client, and the appropriate paths for
engine.client() and ClientBuilder) and keep the surrounding explanatory text
unchanged.

In `@d-engine-server/src/api/embedded_client.rs`:
- Around line 117-119: Update the doc comment to use Rust intra-doc link syntax
instead of plain backticks: replace `EmbeddedEngine`, `GrpcClient`, and
`ClientApi` with proper links like [`EmbeddedEngine`] and [`GrpcClient`] (or
fully-qualified paths such as [`d_engine::EmbeddedEngine`] and
[`d_engine_client::GrpcClient`] if needed) so the references become clickable
and resolve across crates; ensure the link targets match the actual crate paths
and keep the explanatory text unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2e88310-d37d-4846-94ec-f85b12d9494e

📥 Commits

Reviewing files that changed from the base of the PR and between f829f71 and 64b5aeb.

📒 Files selected for processing (10)
  • README.md
  • config/base/README.md
  • config/base/storage.toml
  • d-engine-client/src/grpc_client.rs
  • d-engine-core/src/client/client_api.rs
  • d-engine-core/src/config/security.rs
  • d-engine-server/src/api/embedded_client.rs
  • d-engine/src/docs/overview.md
  • d-engine/src/docs/quick-start-5min.md
  • d-engine/src/docs/quick-start-standalone.md

Comment thread d-engine/src/docs/overview.md Outdated
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@JoshuaChi
JoshuaChi merged commit bd2df00 into main May 27, 2026
9 checks passed
@JoshuaChi
JoshuaChi deleted the doc/396-client-apis branch May 27, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant