dirk_framework

Crates.iodirk_framework
lib.rsdirk_framework
version0.1.1
sourcesrc
created_at2024-11-03 21:23:56.783952
updated_at2024-11-03 21:23:56.783952
descriptionDependency Injection for Rust
homepage
repositoryhttps://github.com/hundsdor/dirk.git
max_upload_size
id1434270
size74,601
Simon Hundsdorfer (hundsdor)

documentation

README

Test

Dirk is a compile-time Dependency Injection tool for Rust, focusing on usability and developer experience.

Etymology

Dependency Injection for Rust at (K)Compile-time

A dirk is a long-bladed thrusting weapon used as personal sidearm by Scottish Highlanders during the 18th century. This tool may be used accordingly as a sidearm for injecting instances into your code.

Furthermore, a dirk resembles a dagger, which pays tribute to the framework Dagger by Google, from which dirk has been inspired.

Comparison with other DI frameworks for Rust

The following small comparison has been derived from an attempt to implement some of the examples using other DI tools for Rust. If you are convinced that I absolutely missed or misinterpreted some aspects here, feel free to contact me and I will do my best to put things right.

Feature dirk teloc shaku waiter_di
injection at compile-time yes yes yes yes
injection of generic types yes no only with manual impl no
global singletons yes no only with manual impl no
expressive error messages as good as possible* no no no
allows (interior) mutability yes yes no no

*procedural macros do not always allow access to all information necessary to yield good error messages

Commit count: 32

cargo fmt