rust-clamav is a safe library for interacting with libclamav from Rust. The low-level C API is wrapped in idomatic and safe Rust code.
bindgen is not used to generate src/ffi.rs
as the libclamav interface is relatively straight forward. This may change in future.
rust-clamav can be tested locally or via Docker.
docker build -t rust-clamav .
docker run -it rust-clamav cargo test
We currently target the latest stable release of Rust (1.26), and Cargo (1.26).
clippy is used for linting, install with: cargo +nightly install clippy
libclamav.so.7
should be available on the PATH
at runtime (or LD_LIBRARY_PATH
if it lives somewhere non-standard).
Debian/Ubuntu minimal example:
$ sudo apt install libclamav7
Freshclam can optionally be installed to keep the defintions in /var/lib/clamav
up to date:
$ sudo apt install clamav-freshclam