Summary
Follow-up polish to oath-adapter-net-api after the #121 vocabulary rename. Three
related improvements, all in the kernel crate. No behaviour change.
1. Self-contained public docs (no ADR citations)
Public rustdoc should explain the API on its own, not send the reader to an internal
ADR. Remove the (ADR-0029 §N) citations from the crate's docs and inline any reasoning
they carried:
compose.rs module doc (§3)
lib.rs module doc (the "cut is clean" signal; §2)
timer.rs (§4)
2. Lock-in tests for compose.rs
The module's central promise — the ordering invariant ("first .layer() is outermost")
— is currently only compile-checked by assert-nothing doctests. Add a #[cfg(test)]
module that executes and asserts:
- outermost-first execution order (layers record their invocation order observably)
Identity passes the value through unchanged
Default == new()
- the zero-cost property (
size_of::<LayerBuilder<Identity>>() == 0; a stack of ZST
layers is still a ZST)
3. #[must_use] on LayerBuilder::wrap()
Discarding the composed value (builder.wrap(leaf);) means assembling a stack and
throwing it away — a bug. Matches the existing #[must_use] on layer() / new().
Scope
oath-adapter-net-api only. Pre-release, workspace-internal.
Summary
Follow-up polish to
oath-adapter-net-apiafter the #121 vocabulary rename. Threerelated improvements, all in the kernel crate. No behaviour change.
1. Self-contained public docs (no ADR citations)
Public rustdoc should explain the API on its own, not send the reader to an internal
ADR. Remove the
(ADR-0029 §N)citations from the crate's docs and inline any reasoningthey carried:
compose.rsmodule doc (§3)lib.rsmodule doc (the "cut is clean" signal; §2)timer.rs(§4)2. Lock-in tests for
compose.rsThe module's central promise — the ordering invariant ("first
.layer()is outermost")— is currently only compile-checked by assert-nothing doctests. Add a
#[cfg(test)]module that executes and asserts:
Identitypasses the value through unchangedDefault==new()size_of::<LayerBuilder<Identity>>() == 0; a stack of ZSTlayers is still a ZST)
3.
#[must_use]onLayerBuilder::wrap()Discarding the composed value (
builder.wrap(leaf);) means assembling a stack andthrowing it away — a bug. Matches the existing
#[must_use]onlayer()/new().Scope
oath-adapter-net-apionly. Pre-release, workspace-internal.