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.
There are different kind of instances:
Resolving a owned instance:
```Rust use rscontainer::ServiceContainer;
let mut container = ServiceContainer::new();
let mut foo = container.resolver().owned::
Resolving a shared instance (singleton):
```Rust use rscontainer::{ServiceContainer, Shared};
let mut container = ServiceContainer::new();
let foo: Shared
foo.accessmut(|foo| { let foo = foo.asserthealthy(); foo.do_something(); }); ```