Skip to content

Add doc comments to all public API items and enforce deny(missing_docs)#2

Merged
eshork merged 2 commits intomainfrom
fix/1-add-missing-doc-comments
Apr 26, 2026
Merged

Add doc comments to all public API items and enforce deny(missing_docs)#2
eshork merged 2 commits intomainfrom
fix/1-add-missing-doc-comments

Conversation

@eshork
Copy link
Copy Markdown
Collaborator

@eshork eshork commented Apr 26, 2026

Summary

Resolves #1.

  • Adds /// doc comments to all 551 previously-undocumented public API items across peeroxide-dht and peeroxide crates
  • Enforces #![deny(missing_docs)] in both crate roots to prevent future regressions
  • Fixes broken intra-doc links in noise_wrap.rs (HandshakeIK, NoisePayload)

Verification

All three build gates pass clean:

Check Result
cargo check --workspace ✅ 0 warnings, 0 errors
cargo test --workspace ✅ 483 pass, 0 fail
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps ✅ clean

Files Changed (16 files, +585 -11)

peeroxide-dht:

  • lib.rs#![deny(missing_docs)] + module-level docs for 11 pub mod declarations
  • compact_encoding.rs — 109 doc items
  • hyperdht.rs — 92 doc items
  • messages.rs — ~40 doc items
  • rpc.rs — ~40 doc items
  • protomux.rs — ~20 doc items
  • blind_relay.rs — 18 doc items
  • noise.rs — 9 doc items
  • crypto.rs — 8 doc items
  • noise_wrap.rs — 4 doc items + fixed broken intra-doc links
  • secret_stream.rs — 3 struct field docs
  • hyperdht_messages.rs — minor doc formatting

peeroxide:

  • lib.rs#![deny(missing_docs)]
  • peer_info.rs — 21 doc items
  • error.rs — 5 doc items
  • swarm.rs — 1 doc item

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread peeroxide-dht/src/messages.rs Outdated
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.
@eshork eshork merged commit ab2ee72 into main Apr 26, 2026
4 checks passed
@eshork eshork deleted the fix/1-add-missing-doc-comments branch April 26, 2026 01:07
This was referenced Apr 26, 2026
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.

Add missing doc comments to public API items in peeroxide-dht and peeroxide

2 participants