extfn - Extension Functions in Rust
extfn is a Rust library that implements extension functions, allowing any* freestanding function to
be called as a.foo(b) instead of foo(a, b) just by adding #[extfn] and renaming the first parameter to self.
use extfn;
use Ordering;
use Display;
A list of all supported function forms can be found here.
Prior Art
Extension functions are already implemented in Kotlin and C#.
As a Rust feature, extension functions have been proposed here, here, here, and here.
Fine Print
- Const functions are unsupported because of E0379
self: T::Associs unsupported