rscontainer

rscontainer is a library for the Rust programming language to manage dependencies between objects. The main type is the ServiceContainer, which serves two purposes: it acts as a registry for shared instances (singletons) and custom constructors, and it provides a mechanism for dependency injection.

For more information see the documentation.

Resolving instances

There are different kind of instances:

How to use

Resolving a owned instance:

```Rust use rscontainer::ServiceContainer;

let mut container = ServiceContainer::new(); let mut foo = container.resolver().owned::(())?; foo.do_something(); ```

Resolving a shared instance (singleton):

```Rust use rscontainer::{ServiceContainer, Shared};

let mut container = ServiceContainer::new(); let foo: Shared = container.resolver().shared()?;

foo.accessmut(|foo| { let foo = foo.asserthealthy(); foo.do_something(); }); ```