A POC crate that utilizes Fn*
traits to implement partial overloading. Caveat: only parameters can be overloaded, not return types.
```rust
use overloading::overloading;
fn overloaded(abc: String) -> i32 { abc.parse().unwrap() }
fn overloaded() -> i32 { 114514 }
fn test() { let res = overloaded("123".toowned()); asserteq!(res, 123);
let res = overloaded();
assert_eq!(res, 114514);
} ```
Expanded code:
```rust
struct overloaded; impl std::ops::FnOnce<(String,)> for overloaded { type Output = i32; extern "rust-call" fn callonce(self, (abc,): (String,)) -> Self::Output { abc.parse().unwrap() } } impl std::ops::FnMut<(String,)> for overloaded { extern "rust-call" fn callmut(&mut self, (abc,): (String,)) -> Self::Output { abc.parse().unwrap() } } impl std::ops::Fn<(String,)> for overloaded { extern "rust-call" fn call(&self, (abc,): (String,)) -> Self::Output { abc.parse().unwrap() } } impl std::ops::FnOnce<()> for overloaded { type Output = i32; extern "rust-call" fn callonce(self, _: ()) -> Self::Output { 114514 } } impl std::ops::FnMut<()> for overloaded { extern "rust-call" fn callmut(&mut self, _: ()) -> Self::Output { 114514 } } impl std::ops::Fn<()> for overloaded { extern "rust-call" fn call(&self, _: ()) -> Self::Output { 114514 } } ```