axum-syntax-custom-extractors
OfficialBuild correct custom extractors for Axum
Software Engineering#axum#rejection#custom extractor#FromRequestParts#FromRequest#axum-macros#FromRef
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
FromRequestPartsfor extractors that do not consume the body andFromRequestfor 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 nativeasync fnin traits, preventing signature mismatches. - Safe rejection wiring: Ensures
RejectionimplementsIntoResponse, and shows how to remap inner rejection types when wrapping existing extractors (e.g., wrappingJson). - State and substate access: Covers extracting one resource from composite state via
FromRef. - Derive macro usage: Documents
#[derive(FromRequest)]/#[derive(FromRequestParts)]and attributes likevia(...),rejection(...), andstate(...). - 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 requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.