axum-syntax-custom-extractors

Official

Build correct custom extractors for Axum

AuthorImpertio-Studio
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Custom extractors often fail in Axum due to version-specific async trait rules, incorrect FromRequest vs FromRequestParts selection, missing or incompatible rejection types, or subtle handler-argument ordering constraints.

Core Features & Use Cases

  • Correct trait choice (body vs parts): Selects FromRequestParts for extractors that do not consume the body and FromRequest for extractors that do, ensuring the body extractor is placed last.
  • Version-correct async implementation: Explains Axum 0.7’s #[async_trait] requirement versus Axum 0.8’s native async fn in traits, preventing signature mismatches.
  • Safe rejection wiring: Ensures Rejection implements IntoResponse, and shows how to remap inner rejection types when wrapping existing extractors (e.g., wrapping Json).
  • State and substate access: Covers extracting one resource from composite state via FromRef.
  • Derive macro usage: Documents #[derive(FromRequest)] / #[derive(FromRequestParts)] and attributes like via(...), rejection(...), and state(...).
  • Common anti-pattern fixes: Resolves compile-time and “Handler is not satisfied” failures caused by ambiguous extractor implementations and misordered arguments.

Quick Start

Ask Claude to produce a custom Axum 0.8 extractor that reads request parts or consumes the body as appropriate, with a Rejection that implements IntoResponse and an example handler that places it in the correct argument position.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: axum-syntax-custom-extractors
Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-syntax-custom-extractors

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.