Add doc comments to all public API items and enforce deny(missing_docs)#2
Merged
Add doc comments to all public API items and enforce deny(missing_docs)#2
Conversation
Resolves #1. Adds /// doc comments to every undocumented public API item across peeroxide-dht and peeroxide crates (551 items total), then enforces #![deny(missing_docs)] in both crate roots to prevent future regressions. Files changed: blind_relay.rs, compact_encoding.rs, crypto.rs, hyperdht.rs, hyperdht_messages.rs, lib.rs (both crates), messages.rs, noise.rs, noise_wrap.rs, protomux.rs, rpc.rs, secret_stream.rs, error.rs, peer_info.rs, swarm.rs.
There was a problem hiding this comment.
Pull request overview
Adds comprehensive Rustdoc coverage across the public APIs of peeroxide-dht and peeroxide, and enforces documentation completeness going forward via #![deny(missing_docs)].
Changes:
- Added
#![deny(missing_docs)]to both crate roots to prevent future undocumented public API items. - Added/expanded
///doc comments for public enums/structs/fields/functions across the DHT and swarm layers. - Fixed broken intra-doc links in
noise_wrap.rs.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| peeroxide/src/lib.rs | Enforces deny(missing_docs) at the crate level. |
| peeroxide/src/error.rs | Documents SwarmError variants. |
| peeroxide/src/peer_info.rs | Documents Priority, PeerInfo fields, and key methods. |
| peeroxide/src/swarm.rs | Documents SwarmConnection::remote_public_key. |
| peeroxide-dht/src/lib.rs | Enforces deny(missing_docs) and adds module-level docs for public modules. |
| peeroxide-dht/src/compact_encoding.rs | Adds public API docs for encoding state, errors, and encode/decode helpers. |
| peeroxide-dht/src/crypto.rs | Documents hashing/signing helpers and precomputed namespaces. |
| peeroxide-dht/src/messages.rs | Documents DHT RPC message types and encode/decode helpers. |
| peeroxide-dht/src/rpc.rs | Documents DhtError, public config/types, DhtHandle API, and spawn. |
| peeroxide-dht/src/protomux.rs | Documents Protomux public error/result types and frame/message structures. |
| peeroxide-dht/src/blind_relay.rs | Documents relay message structs and relay-client error/response types. |
| peeroxide-dht/src/noise.rs | Documents NoiseError and select public API fields/methods. |
| peeroxide-dht/src/noise_wrap.rs | Fixes intra-doc links and documents NoiseWrapError. |
| peeroxide-dht/src/secret_stream.rs | Documents SecretStreamError and public error payload fields. |
| peeroxide-dht/src/hyperdht_messages.rs | Documents wire constants, message structs, and encode/decode helpers. |
| peeroxide-dht/src/hyperdht.rs | Documents HyperDhtError, public result/config structs, handle methods, and server APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update doc comment to note the struct may hold either address family, and that the name is inherited from the upstream JS implementation. Addresses PR review feedback from Copilot.
This was referenced Apr 26, 2026
Closed
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #1.
///doc comments to all 551 previously-undocumented public API items acrosspeeroxide-dhtandpeeroxidecrates#![deny(missing_docs)]in both crate roots to prevent future regressionsnoise_wrap.rs(HandshakeIK,NoisePayload)Verification
All three build gates pass clean:
cargo check --workspacecargo test --workspaceRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-depsFiles Changed (16 files, +585 -11)
peeroxide-dht:
lib.rs—#![deny(missing_docs)]+ module-level docs for 11pub moddeclarationscompact_encoding.rs— 109 doc itemshyperdht.rs— 92 doc itemsmessages.rs— ~40 doc itemsrpc.rs— ~40 doc itemsprotomux.rs— ~20 doc itemsblind_relay.rs— 18 doc itemsnoise.rs— 9 doc itemscrypto.rs— 8 doc itemsnoise_wrap.rs— 4 doc items + fixed broken intra-doc linkssecret_stream.rs— 3 struct field docshyperdht_messages.rs— minor doc formattingpeeroxide:
lib.rs—#![deny(missing_docs)]peer_info.rs— 21 doc itemserror.rs— 5 doc itemsswarm.rs— 1 doc item