indep

Crates.ioindep
lib.rsindep
version0.1.1
sourcesrc
created_at2016-08-20 18:03:02.390166
updated_at2016-09-25 09:21:50.106901
descriptionDepencency injection library for Rust
homepage
repositoryhttps://github.com/snuk182/indep
max_upload_size
id6040
size38,384
Serhii Plyhun (snuk182)

documentation

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:

[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.

Dependencies

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

License

  • MIT
Commit count: 20

cargo fmt