portaldi/lib.rs
1//! **PortalDI** is an ergonomic, lightweight and compile-time dependency injection library.
2//!
3//! # Features
4//!
5//! * Natively async support
6//! * Support for asynchronous component creation.
7//! * Components and traits must be `thread-safe` (`Sync + Send`) in non Wasm target.
8//!
9//! * Ergonomic apis
10//! * In most cases, you can use target types directly instead of using containers.
11//! ```ignore
12//! // for a concrete type.
13//! let hoge: DI<HogeService> = HogeService::di();
14//!
15//! // for a trait. (through DIProvider)
16//! let hoge: DI<dyn HogeService> = HogeServiceProvider::di();
17//! ```
18//!
19//! * DRY support by macros
20//! * Almost boiler codes can be generated by proc macros.
21//! ```ignore
22//! #[derive(DIPortal)]
23//! struct HogeService {
24//! foo: DI<FooService>,
25//! ...,
26//! }
27//! ```
28//!
29
30pub use portaldi_core::{container::*, traits::*, types::*};
31pub use portaldi_macros::*;
32
33pub mod docs;