overrider-rs
overrider is a set of Rust crates that provide overloading of functions, methods, and more. For example:
// main.rs
use *;
Calling foo() will print Hello World. However, if an override_default version
of foo is defined:
// main.rs
use *;
Calling foo() will now print Hello Za Warudo. The first function definition may remain.
Using
Due to limitations in proc_macro, overrider requires the use of two crates:
overriderfor code insrcoverrider_buildfor a build script such asbuild.rsThe code from above shows how to use theoverridercrate. Below is how to use the build portion:
// build.rs
use watch_files;
For examples, see the git repo.