- 26 Feb 22 10 min read
In this article we will look at type-maps and how they can help enable dependency injection in Rust. We will go a few steps further to look at how we can provide auto wiring of arguments to a given callable, utilising generics and a few traits. This is a pattern seen in frameworks such as Bevy and Actix-Web to provide shared state back to the user.