generic-injection

Community

Automate generic dependency injection in Rust

Authorjymchng
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the challenge of making generic structs injectable in Rust, enabling seamless propagation of type parameters through Provider and Injectable impls.

Core Features & Use Cases

  • Generic Struct Injection: Allows generic structs to be injected with dependencies, facilitating reuse and flexibility.
  • Type Propagation: Ensures type parameters are passed through to generated Provider and Injectable impls.
  • Axum Compatibility: Works seamlessly with Axum, allowing dependencies to be injected into handler signatures.
  • Fail Early: Detects circular dependencies, missing registrations, and scope mismatches during container build phase.
  • Testing Flexibility: Enables direct testing of constructors without the container.

Quick Start

Use the generic-injection skill to make a generic struct like 'Wrapper<T>' injectable, and resolve it with 'container.resolve::<Wrapper<Database>>()'.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 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: generic-injection
Download link: https://github.com/jymchng/injectable/archive/main.zip#generic-injection

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 620,000+ vetted skills library on demand.