Skip to content

[Good First Issue]: Add Header<T> example to documentation and rustdoc #645

Description

@juv

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

  • Documentation page for Rapina Extractors is updated
  • Header<T> Rustdoc is updated with a clear example

Estimated Effort

XS — < 30 minutes

Hints & Resources

  • Follow existing patterns in the documentation / rustdoc

Maintainer Checklist

  • Issue is self-contained and scoped for a first-time contributor
  • Relevant files and context are provided above
  • Acceptance criteria are clear and verifiable

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions