Rust ClamAV Client

March 2024

At the height of my professional Clojure career and during the Covid lockdown in 2020, a friend started recommending Rust to me. I had heard about Rust before, but as I was happy working with Clojure and an interactive REPL, I wasn’t very interested in it at the time.

Other friends started mentioning Rust and how much they liked it. I kept ignoring it.

Embedded Rust

About a year later and with some free time, I developed an interest in embedded systems programming. Not keen on using C, I came across The Embedded Rust Book, ordered a STM32F3DISCOVERY board and started tinkering.

Now, embedded systems programming is very different from “normal” programming. It lacks a standard library and runtime. You have to cross-compile your code and use semihosting to access log messages. Everything seems to be more complicated and comes with a steep learning curve—it did for me at least.

It was a fun challenge and I was hooked on Rust. However, I prefer learning through projects I can share and which might be valuable to others, rather than through exercises in a book. And not being an expert in embedded systems, I struggled to find an appropriate and useful project to work on.

ClamAV Client

One day, while browsing the crate A crate is a package that can be installed with cargo, Rust’s official package manager. registry crates.io, I realized a canonical Rust ClamAV client hadn’t emerged yet.

“ClamAV is an open-source antivirus engine for detecting trojans, viruses, malware and other malicious threats.”

Having extensive experience with ClamAV from various consulting projects, I was able to focus on learning Rust and its ecosystem while aiming to deliver an easy-to-use, well-tested, and well-documented library.

I created a new Cargo project, fired up Visual Studio Code using rust-analyzer, and got to work. After some thorough code reviews and improvements by my friend Christopher Prohm, the first version of clamav-client was published on crates.io in May 2021.

The open-source project is hosted on GitHub and saw other contributors join over time, adding support for Tokio and async-std Tokio and async-std are popular asynchronous Rust runtimes. as well as other improvements.

I’m not sure clamav-client is the canonical Rust ClamAV client just yet, but it seems to be doing reasonably well Judging by the number of downloads. and I’m open to feature requests and plan to maintain it for the foreseeable future.

Work With Me

Feel free to contact me should you require assistance with Rust or ClamAV.

See all posts