injectables 0.1.0

A procedural macro library that enables field injection between Rust structs through #[injectable] and #[inject_fields] attributes. The library handles visibility rules, generic type resolution, and detects circular dependencies during compile time to ensure safe composition. This enables a declarative approach to struct composition where fields from one or more source structs can be automatically injected into target structs while respecting Rust's ownership and visibility rules.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
error: Only structs are supported
 --> tests/fail/enum_injection.rs:3:1
  |
3 | #[injectable]
  | ^^^^^^^^^^^^^
  |
  = note: this error originates in the attribute macro `injectable` (in Nightly builds, run with -Z macro-backtrace for more info)

error: Cannot inject fields from 'Invalid' as this type does not exist
 --> tests/fail/enum_injection.rs:9:1
  |
9 | #[inject_fields(Invalid)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the attribute macro `inject_fields` (in Nightly builds, run with -Z macro-backtrace for more info)