fibre_ioc is an Inversion of Control container for Rust. You register how each service is built, as a ready-made instance, a singleton factory or a transient factory. The container then hands out shared Arc handles when code asks for them. Services can be registered and resolved by concrete type or by trait object. Each registration can carry a name so one type can have several providers.
The problem it solves is wiring. A service that depends on a repository trait should not have to know which repository it gets. With fibre_ioc the service's factory asks the container for trait UserRepo. Whoever set up the container decides whether that is the real database, an in-memory store or a test double.
Registration is dynamic. There is no single build step that freezes the graph: you can add providers at any point and from any thread. Singletons are only built the first time something resolves them. The thread-safe Container sits on concurrent maps, the global() function gives you an application-wide instance and Container::new() gives you an isolated one for tests. A local feature adds LocalContainer, which uses Rc and can hold types that are not Send or Sync.
Missing required services and circular dependencies panic with a clear message instead of overflowing the stack. Optional dependencies go through maybe_resolve!, which returns an Option.
use ;
use Arc;
;
