Show HN: a Rust crate to mock concrete type without using trait
Category: devtools
Tags: rust, testing, mocking, unit-testing, devtools
Score: 8.3/10 (Innovation: 8, Technical: 9, Documentation: 9, Utility: 7)
shimforge is a Rust crate that enables mocking of concrete functions without requiring trait abstractions or production code changes, using runtime function patching (likely via dynamic linking or inline hooking). It provides a fluent API for expectations, argument matching, call counts, and sequences, with thread-local and global sessions. The project is notable for solving a longstanding pain point in Rust testing by avoiding trait indirection while maintaining safety and cross-platform support.
Target audience: Rust developers, backend developers, test engineers
Repository: https://github.com/XTSoftwareLabs/shimforge · Rust · MIT · 10 stars
View on Hacker News