inject-fn-macro

Community

Simplify Dependency Injection with Async Factories

Authorjymchng
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The problem solved is the difficulty in writing dependency-injected factory functions for async Rust applications.

Core Features & Use Cases

  • Transform Functions into Factories: Easily create factory functions for dependencies with the #[injectable(factory)] macro.
  • Async Compatibility: Ensure factory functions work well with async applications.
  • Compile-time Safety: Prevent runtime errors like circular dependencies and missing registrations during build time.
  • Unit Testing: Allows for easy unit testing by using plain Rust constructors directly.

Quick Start

Create an async factory for database pooling using the provided macro.

Dependency Matrix

Required Modules

None required

Components

Standard package

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

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.