Summary
The current documentation only outlines the Headers extractor: https://userapina.com/docs/core-concepts/extractors/#headers
Rapina includes another extractor, Header<T>, which gives access to a single header and is preferred to be used if only individual headers are required as per comment in the Headers extractor impl:
Prefer Header<T> when you know the header name upfront.
The Header<T> extractor and the remark to prefer Header<T> when accessing a single header with a known name is not reflected in the documentation.
Why This Matters
Clear examples in the documentation and a guideline when to prefer which of the two similar extractors.
Relevant Files
Extractors docs: https://github.com/rapina-rs/rapina/blob/main/docs/content/docs/core-concepts/extractors.md
Header<T> impl: https://github.com/rapina-rs/rapina/blob/main/rapina/src/extract/header.rs#L33-L36
Headers impl: https://github.com/rapina-rs/rapina/blob/main/rapina/src/extract/mod.rs#L140-L166
The Header<T> was added in pull request #542
Acceptance Criteria
Estimated Effort
XS — < 30 minutes
Hints & Resources
- Follow existing patterns in the documentation / rustdoc
Maintainer Checklist
Summary
The current documentation only outlines the
Headersextractor: https://userapina.com/docs/core-concepts/extractors/#headersRapina includes another extractor,
Header<T>, which gives access to a single header and is preferred to be used if only individual headers are required as per comment in theHeadersextractor impl:The
Header<T>extractor and the remark to preferHeader<T>when accessing a single header with a known name is not reflected in the documentation.Why This Matters
Clear examples in the documentation and a guideline when to prefer which of the two similar extractors.
Relevant Files
Extractors docs: https://github.com/rapina-rs/rapina/blob/main/docs/content/docs/core-concepts/extractors.md
Header<T>impl: https://github.com/rapina-rs/rapina/blob/main/rapina/src/extract/header.rs#L33-L36Headersimpl: https://github.com/rapina-rs/rapina/blob/main/rapina/src/extract/mod.rs#L140-L166The
Header<T>was added in pull request #542Acceptance Criteria
Header<T>Rustdoc is updated with a clear exampleEstimated Effort
XS — < 30 minutes
Hints & Resources
Maintainer Checklist