Method Overloading (kinda), and Advanced Trait Usage - Quick Rust

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Kinda polymorphism, kinda method overload, kinda everything 😂 great video!!

albertoromero
Автор

The last example can be called like this too
fn main() {
MyStruct::method(1);
MyStruct::method(1.0);
}
because the compiler picks the correct trait-method by the arguments data-type. Nice video, reminded me again that this is doable in Rust :)

MichaelKefeder