Skip to main content

Crate injectable_rs_macros

Crate injectable_rs_macros 

Source
Expand description

Proc macros for the injectable DI framework.

§Provided Macros

All macros use #[injectable(...)] as the unified entry point:

  • #[injectable] on struct — field injection
  • #[injectable] on impl block — constructor injection
  • #[injectable(ctor)] on method — marks the injection constructor
  • #[injectable(post_construct)] on method — lifecycle: runs after construction
  • #[injectable(pre_destruct)] on method — lifecycle: runs before shutdown
  • #[injectable(trait)] on trait — dynamic dispatch support for Inject<dyn Trait>
  • #[injectable(factory)] on fn — transforms a function into a DI-compatible async factory
  • bind!() — creates a static binding from a trait to a concrete type

Macros§

bind
Macro to create a static binding from a trait to a concrete type.
container
Macro for compile-time dependency graph validation and container construction.

Attribute Macros§

injectable
Unified DI attribute macro.