More Dependency Injection

More DI is a dependency injection (DI) library for Rust. A trait or struct can be used as the injected type.
You may be looking for:
Features
This crate provides the following features:
- default - Abstractions for dependency injection, plus the builder and inject features
- builder - Functions for configuring service descriptors
- async - Use dependencies in an asynchronous context
- inject - Code-generate common injection scenarios
- lazy - Lazy-initialize service resolution
- fmt - Additional output formatting
- alias - Use alternate type aliases
Supported Lifetimes
A service can have the following lifetimes:
- Transient - a new instance is created every time it is requested
- Singleton - a single, new instance is created the first time it is requested
- Scoped - a new instance is created once per provider that it is requested from
Dependency Injection in Action
Consider the following traits and structures.
Proc macro attributes are not required, but they are the fastest and simplest approach to add DI in your applications.
use *;
use Rc;
;
This information can now be composed into a simple application:
use crate::*;
use *;
License
This project is licensed under the MIT license.