Rust Traits vs Go lang Interfaces

preview_player
Показать описание
While the image may be a fight, this is more of a compare and contrast, between the two approaches, they both have advantages, and disadvantages.

I have been enjoying working in rust recently, and Generics has been a big part of that, so Bring on the traits.
Рекомендации по теме
Комментарии
Автор

In rust you can have a vec of a and b using & dyn. This may be a new feature. The dyn can be any trait. This imo is very powerful.

darkenblade
Автор

If I were writing this code in Rust, I'd probably use an enum instead of a trait.

JeffreyRennie
Автор

I do use gofmt. Though I haven't got rustfmt working yet.

mybigbeak