axum-syntax-responses
OfficialReturn valid Axum responses every time.
Software Engineering#cookies#redirect#axum#handler return types#IntoResponse#response tuples#axum 0.8
AuthorImpertio-Studio
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It prevents Axum handler return-value mistakes that either fail compilation or silently produce incorrect HTTP responses, especially around IntoResponse / IntoResponseParts tuple rules, status/header/body ordering, redirect status codes, cookie jar behavior, and the Axum 0.8 body type.
Core Features & Use Cases
- IntoResponse return typing: Ensures your handler returns a type that actually implements IntoResponse (e.g., Json, Html, Redirect, StatusCode, Response), avoiding Handler trait bound failures.
- Tuple composition correctness: Guarantees correct use of (StatusCode, parts..., body) and enforces that the body is the final tuple element while earlier elements are IntoResponseParts.
- Status, headers, and cookies right: Correctly combines status and headers (including AppendHeaders for multiple Set-Cookie), picks correct Redirect constructors (303/307/308 only), and ensures the modified CookieJar is returned.
- Axum 0.8 body requirement: Uses axum::body::Body instead of hyper::Body when manually building a Response.
- Common scenarios: Returning JSON/HTML/raw bytes, setting response headers, redirecting after POST/PUT, mapping fallible results to responses with Result, and applying cookie-based session/auth patterns.
Quick Start
Use axum-syntax-responses when your Axum handler must return a proper status/headers/body (or cookies/redirects) or when compilation fails with an IntoResponse/Handler trait-bound error.
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-responses Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-syntax-responses 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.