API Reference
The full Rust API reference is auto-generated from source-code doc comments by rustdoc and published alongside this book. On the published documentation site, navigate directly to the links below.
Browse Online
Key Entry Points
| Module | Description | Link |
|---|---|---|
red_couch | Crate root — module registration, TCP listener, connection handling | red_couch |
red_couch::protocol | Binary protocol types, opcode enum, request parser, response encoder | protocol |
red_couch::ascii | ASCII text protocol parser and command dispatch | ascii |
red_couch::meta | Meta protocol parser, flag validation, command types | meta |
Commonly Referenced Items
Opcode— all supported binary-protocol opcodesRequest— parsed binary requestHeader— parsed request headerParseResult— parse outcome (Ok / Incomplete / error)try_parse_request— primary request parserwrite_response— binary response encoderResponseMeta— response metadata fields
Generating Locally
# Build and open in your browser
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --open
The generated docs cover all public types, functions, and modules in the red_couch crate. They are rebuilt from source on every change, so they always reflect the current code.
How It Works
The GitHub Actions Pages workflow builds both the mdBook site and the rustdoc output in a single job:
mdbook buildproduces the narrative documentation inbook/output/.cargo doc --no-depsproduces the API reference intarget/doc/.- The workflow copies
target/doc/intobook/output/api/, so the final Pages artifact has the structure:book/output/ ├── index.html ← mdBook site root ├── api/ │ └── red_couch/ ← rustdoc API reference │ ├── index.html │ ├── protocol/ │ ├── ascii/ │ └── meta/ └── ... ← other book chapters
The links on this page point into the api/ subtree, so they work on the published site.
CI Validation
The CI pipeline validates that both the API documentation and the book build cleanly on every push to main and on pull requests:
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
mdbook build
This ensures documentation stays in sync with the code and catches broken links or build errors before merging.