axum-core-state
OfficialShare Axum app state safely—no runtime 500s.
Software Engineering#axum state#router with_state#state extractor#fromref#extension trap#tokio mutex#handler is not satisfied
AuthorImpertio-Studio
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill prevents common Axum state-wiring failures where handlers extract shared state but the router never provides it, or where application-wide resources are injected via Extension and silently fail at runtime.
Core Features & Use Cases
- Compile-time correct state wiring: Use Router<S> with Router::with_state to make only Router<()> serveable, catching missing wiring before deployment.
- State extraction and substate composition: Use State<S> plus FromRef and derive(FromRef) to pull per-handler substates from a larger AppState.
- Performance and correctness guardrails: Ensure state is Clone, wrap heavy immutable data in Arc, and use tokio::sync::Mutex (or scope std::sync::Mutex) to avoid !Send futures caused by holding a mutex guard across .await.
Quick Start
Ask Claude to show how to restructure your Axum router to provide AppState via Router::with_state and extract only the needed fields with State and derive(FromRef), fixing both the Extension 500 trap and any Handler is not satisfied errors.
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-core-state Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-core-state 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.