Ferrunix
A simple, idiomatic, and lightweight dependency injection framework for Rust.
[![Build Status](https://github.com/leandros/ferrunix/actions/workflows/ci.yml/badge.svg)](https://github.com/leandros/ferrunix/actions)
[![Crates.io](https://img.shields.io/crates/v/ferrunix.svg)](https://crates.io/crates/ferrunix)
[![API reference](https://docs.rs/ferrunix/badge.svg)](https://docs.rs/ferrunix/)
![MSRV](https://img.shields.io/crates/msrv/ferrunix)
![License](https://img.shields.io/crates/l/ferrunix.svg)
```toml
[dependencies]
ferrunix = "0.3"
```
*Compiler support: requires rustc 1.67.1+*
**Check out the [User Guide](https://leandros.github.io/ferrunix/user-guide/first-steps.html).**
## Documentation
Due to how the various features affect the public API of the library, the
documentation is provided for each major feature separately.
| Feature Flags | Link to Documentation |
| ------------------- | --------------------- |
| `none` | [link to docs](https://leandros.github.io/ferrunix/docs-default/ferrunix/) |
| `multithread` | [link to docs](https://leandros.github.io/ferrunix/docs-multithread/ferrunix/) |
| `tokio` | [link to docs](https://leandros.github.io/ferrunix/docs-multithread/ferrunix/) |
## Features
- Can register and inject any type (incl. generics, types must be `Send` if the
`multithread` feature is enabled, and `Send + Sync` if `tokio` is enabled).
- Simple and elegant Rust API; making the derive macro purely optional.
- Different dependency lifetimes:
- **Singleton**: Only a single instance of the object is created.
- **Transient**: A new instance is created for every request.
- Dependency resolution happens at run time, making it possible to dynamically
register types.
- Injection of concrete value types (`T`), `Box