1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! he_di provides a derive macro to generate implementations of the
//! Component traits for data structures defined in your crate,
//! allowing them to be 'registered' and 'resolved' from a Container
//!
//! This functionality is based on Rust's #[derive] mechanism,
//! just like what you would use to automatically derive implementations
//! of the built-in Clone, Copy, Debug, or other traits.
//! It is able to generate implementations for most structs.
//! For now enums including ones with elaborate generic types or
//! trait bounds. On rare occasions, for an especially convoluted
//! type you may need to implement the trait manually.
//!
//! # How-to
//!
//! These derives require a Rust compiler version 1.15 or newer.
//!
//! - Add he_di = "0.2" as a dependency in Cargo.toml.
//! - Add he_di_derive = "0.2" as a dependency in Cargo.toml.
//! - If you have a main.rs, `add #[macro_use] extern crate he_di_derive` there.
//! - If you have a lib.rs, add `#[macro_use] extern crate he_di_derive` there.
//! - Use `#[derive(Component)]` on structs that you want to flag as Component which you want to inject or be injected.
//! - Specify the interface this Component is implementing through `#[interface(MyTrait)]`
//!
//! # #[derive(Component)] macro
//!
//! Supported attributes
//! - interface: for a struct, name of the Trait that this Component will implement
//! - inject: for a struct's property, tag a property as being a dependency to another Component (currently only supports `Box<Interface>` synthax)
// The `quote!` macro requires deep recursion.
extern crate anymap;
extern crate he_di_internals;
extern crate lazy_static;
extern crate log;
extern crate proc_macro;
extern crate quote;
extern crate syn;
use TokenStream;
pub
pub
pub
pub