+++ date = '2024-12-29T13:42:30+01:00' draft = true title = 'Mocking in Rust with Dependency Injection' summary = "Learn more about me and why I am starting this blog." tags = ["rust", "testing"] +++ {{< lead >}} Rust is hard. {{< /lead >}} That's one of my takeways from a recent endeavor during the winter break. {{< forgejo repo="ghoscht/picoKontroller" >}} ## TL;DR Rust isn't necessarily suited for pure object oriented programming. ## Getting Started Use [Shaku](https://github.com/AzureMarker/shaku) and [Mockall](https://github.com/asomers/mockall) {{< highlight rust "linenos=table" >}} #[derive(Parser)] #[command(version, about, long_about = None)] struct Cli { #[arg(long, help = "List all available MIDI devices.")] list_midi: bool, #[arg(long, help = "List all available MPRIS players.")] list_mpris: bool, } {{< / highlight >}}