resolve-context

Resolve services in Axum extractors and factory closures with compile-time type safety.

Updated May 10, 2026
One-click install
npx skills add https://github.com/jymchng/injectable --skill resolve-context-jymchng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resolve-context
Source: https://github.com/jymchng/injectable/tree/main/skills/resolve-context
Command: npx skills add https://github.com/jymchng/injectable --skill resolve-context-jymchng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies dependency resolution within factory closures or custom extractors, enhancing the efficiency of Axum handler implementations by reducing runtime reflection overhead.

Core Features & Use Cases

  • Service Extraction in Closures: Enables efficient extraction of services in factory closures.
  • Custom Extractors: Supports the development of custom Axum extractors that integrate dependency resolution.
  • Axum Handler Optimization: Optimizes Axum handler performance by avoiding unnecessary reflection at runtime.

Quick Start

To extract a service in a factory closure, use the 'resolve-context' skill as follows:

DynProvider::with_ctx(|ctx| async move {
    let cfg: Inject<AppConfig> = ctx.extract().await?;
    // Additional logic...
})

Frequently Asked Questions about resolve-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract services in Axum custom extractors?

To extract services in Axum custom extractors, use the resolve-context skill to provide service resolution within factory closures, ensuring compile-time type safety and reducing runtime reflection overhead for efficient dependency injection.

What is the best way to optimize Axum handler performance with dependency injection?

The best way to optimize Axum handler performance with dependency injection is to use service resolution within factory closures or custom extractors, avoiding unnecessary runtime reflection and enhancing compile-time type safety.

How do I set up dependency injection in Rust factory closures with Axum?

Set up dependency injection in Rust factory closures with Axum by utilizing DynProvider::with_ctx to pass context, allowing the async extraction of services like Inject<AppConfig> directly inside the closure logic.

Does this dependency injection approach work with compile-time type safety in Rust?

Yes, this dependency injection approach works with compile-time type safety in Rust, focusing on resolving services within Axum extractors and factory closures to maintain efficient type checking during compilation.

Why does my Axum handler have high runtime reflection overhead during service extraction?

High runtime reflection overhead in Axum handlers often occurs without optimized service extraction; utilizing factory closures for dependency resolution reduces this overhead by enforcing compile-time type safety.

Can I extract multiple services inside a single factory closure in Axum?

Yes, you can extract multiple services inside a single factory closure in Axum by calling the extract method on the provided context multiple times to resolve various injected dependencies asynchronously.