10 releases

new 0.2.9 Apr 29, 2025
0.2.8 Apr 28, 2025
0.1.1 Apr 15, 2025

#566 in Rust patterns

Download history 156/week @ 2025-04-15 395/week @ 2025-04-22

551 downloads per month
Used in 2 crates

MIT license

25KB
611 lines

Rioc - Rust IOC/DI Framework

A lightweight Inversion of Control (IoC) and Dependency Injection (DI) framework for Rust applications.

Features

  • Dependency injection container
  • Interface-based programming support
  • Lightweight and fast
  • Thread-safe implementation

Installation

Add this to your Cargo.toml:

[dependencies]
rioc = "0.1.0"

Basic Usage

use rioc::containers::Container;

// Define your interfaces and implementations
// ...

// Create a container and register your dependencies
let mut container = Container::new();
container.register::<dyn MyInterface, MyImplementation>();

// Resolve dependencies
let service: Box<dyn MyInterface> = container.resolve().unwrap();

Documentation

Coming soon...

License

MIT

Dependencies

~255–700KB
~16K SLoC