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
use injectables::{injectable, inject_fields};

#[injectable]
pub struct GenericPair<T, U> {
  pub first: T,
  pub second: U,
}

#[inject_fields(GenericPair<i32, String>)]
pub struct MultiContainer {
  pub name: String,
}

fn main() {
  let container = MultiContainer {
    name: "Test".to_string(),
    first: 42,
    second: "Hello".to_string(),
  };
  assert_eq!(container.first, 42);
  assert_eq!(container.second, "Hello");
}