Crates.io | indep |
lib.rs | indep |
version | 0.1.1 |
source | src |
created_at | 2016-08-20 18:03:02.390166 |
updated_at | 2016-09-25 09:21:50.106901 |
description | Depencency injection library for Rust |
homepage | |
repository | https://github.com/snuk182/indep |
max_upload_size | |
id | 6040 |
size | 38,384 |
Dead simple Dependency Injection library in Rust.
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
:
[dependencies]
indep = "*"
And the following - to the crate root:
#[macro_use]
extern crate indep;
#[macro_use]
extern crate log;
Also, depending on the sync/async version of macros, you will need several usage definitions, either:
use std::rc::Rc;
use std::cell::RefCell;
use std::fmt::{Display,Formatter,Result};
or
use std::sync::Arc;
use std::sync::RwLock;
use std::fmt::{Display,Formatter,Result};
respectively, and
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.
None except log, which is used only to trace!
dependency injections.