Generic traits as an alternative to method overloading

Hey,
I've just created a little screencast about how generic traits could be used as an alternative to method overloading, which is not possible in Rust.
I happened to discover this technique when I was working on ta crate (https://github.com/greyblake/ta-rs), a technical analysis library.

I think the technique can be useful in some cases, when From and Into traits are just not enough (when method have to keep really different behaviour).

So, here is the video: Rustcast #8 - Generic traits as an alternative to method overloading in Rust programming language - YouTube

1 Like