Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/snuk182/indep

An attempt to make a Dependency Injection library in Rust
https://github.com/snuk182/indep

dependency-injection rust

Last synced: about 1 month ago
JSON representation

An attempt to make a Dependency Injection library in Rust

Awesome Lists containing this project

README

        

# indep
Dead simple Dependency Injection library in Rust.

## Documentation

The library contains support for single- and multi-threaded environments. See examples/sync.rs and examples/async.rs respectively, everything is described there.

Put the following in your `Cargo.toml`:

```toml
[dependencies]
indep = "*"
```

And the following - to the crate root:

```rust
#[macro_use]
extern crate indep;
#[macro_use]
extern crate log;
```

Also you will need several usage definitions:
```rust
use your_mod::{Dependency,Dependent,Implementation};
```
in DI-enabled trait implementations, where your_mod is module in your project where the pool creation macro is applied.

## Dependencies

None except `log`, which is used only to `trace!` dependency injections.

## License

* MIT OR Apache-2.0